I want to write code on a filewatcher service that looks for the file on the server every 30 minutes. Also it should check weather the file is locked by the other user. I am using C# .NET for this. Can anyone Help Please.....?
I want to write code on a filewatcher service that looks for the file on the server every 30 minutes. Also it should check weather the file is locked by the other user. I am using C# .NET for this. Can anyone Help Please.....?
FileSyswatcher is a service of Windows that controls covered determining on your fixed disc. Verification for all the modifications in a directory comprised is sottodirectory and of the rows. application allows you :
- To keep check on changes made to directories.
- Log which user made what changes to which directories and files on what date and time.
- Generate a HTML report for the daily logs.
FileSysWatcher is written in C # and Net 1.1. FileSysWatcher will come executed on all platforms MS Windows that support the services of Windows. Draft of a Windows service that uses many powerful functionalities of NET.
The specific thing about a service is that it need to interact with the Windows SCM (service control manager).
I am attaching some of the attachments here hope it works for you :
Hopefully This would be helpful...!Code:public bool FileLocked(string file) { StreamReader sreader; try { sreader = File.OpenText(file); return false; } catch (Exception ex) { //TODO: write to the log file that other user has opened the file return true; } finally { sreader.Close(); sreader = null; } }
Bookmarks