Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm working on an application where I video record the screen of the script running. I use SharpAvi for recording the screen and I would like to set a time for deleting the file. The only way I found is to run a batch that looks for files older than 7 days or so. I would like to have to set the delete time upon creation. I'm not sure if there is a way to do that or even of Windows support this kind of file creation.
Rather than using a batch file, create a RemoveOldRecordings method in your application that is called when your application is started. Use the GetFiles to read your "recording" directory, deleting "recording" files with LastWriteTime more than 7 days ago.
If you allow the users to save the recordings to different locations, though, you should not automatically delete files without their confirmation.
Also, while testing, rather than delete files, just output the filenames you've identified for delete to log or console window until you're sure you're handling that correctly.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am wondering is there is anyway for the OS to delete automatically created temp directories.
I am working with an application in C sharp and I create a directory in the temp directory (I get the address with the GetTempPath()), I put a bunch of files in this temp directory.
The problem is, I want that this temp directory to be deleted (with all its content) when the files are no more used (when exactly, I don't care, after logging out or restarting the OS it would be a good solution) in order not to saturate the memory because each time I open a temp directory I open it with a different (random) name, which is necessary in my case. The directory and files still exist after a few days, I checked, so I guess there is something that needs to be done when creating it in order to tell the OS to delete it.
Would it be possible?
thanks,
Josh
Well - one way, would be to check the Delete temporary files that my apps aren't using box in settings (windows 10)
just type in 'storage sense' in the windows search bar.
Also see: https://answers.microsoft.com/en-us/windows/forum/all/storage-sense-configuration-for-deleting-temporary/321616d1-e6a7-413a-8246-28f88f5ecc4e
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I created an excel report within the Azure function. I am trying to launch this excel file at the end of the process. But I get this error this is not supported in the OS.
I tried the following code.
System.Diagnostics.Process.Start(reportSavePath);
How you open the newly created file will depend upon the type of trigger that you are using in your function. It doesn't make sense to try to open the file within the context of the function itself, as that is just code running on one of MS's server somewhere. You have a few options.
If you are using an HttpTrigger, you can return the file's byte stream in the response.
If you are using one of the queue, event, or timer type triggers, you'll need to save the file to some sort of external storage, like Azure Storage, before your function exits. You can then download the file from that storage.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Here is a question not about code but about patterns. I'm developing a .Net application that needs to use three files in order to work properly.
File 1: Has the app settings created by a configuration form
File 2: Binary file that contains a set of serialized objects used as a playbook that the application follows in order to realize sequential tasks.
File 3: A sqlite database used as a record cache that the application updates on every start
Now my question is about file location, where to put this files? On Program Files or AppData inside the users's Documents And Settings.
Thanks in advance.
AppData should always be preferred, since it requires less permissions (you might need Administrator permissions to create / updated files in Program Files).
Also it depends whether data should be personalized or global for all users. Take a look at this post
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have specific trouble: I'm using Yandex.Disk cloud storage and working with this by Yandex.Disk REST API. I have some functionality for syncing data and saving to db. Specially it's file name, file md5, file download url. But trouble is that download url is temporary. And I'm looking for solution, to have ability for apdating download url for all saved in db files, each 24 hours. First solution I found is another project that will be launching by windows task scheduler, but my hosting provider not giving this ability. Help me please to find good solution for this.
You can probably use hangfire http://hangfire.io/ to create a recurring task within your ASP.NET application.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a solution under TFS source control and had written some sample code using an external library that was deleted a few months ago. I am certain that the code was checked in before that class file was deleted.
I am able to manually browse to previous versions of even deleted files and copy old code but the number of check-ins is massive since then.
Is there a way to programmatically access TFS history using C# so I can automate the process of "Find in historic/deleted files"?
I know people have written scripts in PowerShell for TFS but I'd prefer to write a C# utility if it is possible. Any hints in the right direction would be appreciated.
Shai Raiten's Blog is great for learning the TFS API.
For getting file history - read this post:
http://blogs.microsoft.co.il/shair/2014/09/10/tfs-api-part-55-source-control-get-history/