Results 1 to 5 of 5

Thread: .net windows service c# filewatcher code

  1. #1
    Join Date
    Mar 2009
    Posts
    49

    .net windows service c# filewatcher code

    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.....?

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: .net windows service c# filewatcher code

    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 :

    1. To keep check on changes made to directories.

    2. Log which user made what changes to which directories and files on what date and time.

    3. 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.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: .net windows service c# filewatcher code

    The specific thing about a service is that it need to interact with the Windows SCM (service control manager).

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Re: .net windows service c# filewatcher code

    I am attaching some of the attachments here hope it works for you :

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: .net windows service c# filewatcher code

    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;
    }
    }
    Hopefully This would be helpful...!

Similar Threads

  1. Replies: 3
    Last Post: 21-09-2011, 07:37 PM
  2. Replies: 5
    Last Post: 26-03-2010, 06:23 PM
  3. Windows XP Service Pack 3 Error Code: 0x80070005
    By K. Becker in forum Windows Update
    Replies: 7
    Last Post: 10-03-2010, 11:11 AM
  4. Error Code 8024200d Windows Vista Service Pack 1
    By William Wade in forum Vista Help
    Replies: 2
    Last Post: 14-01-2010, 09:46 PM
  5. windows service pack error code 3701
    By Kurtz in forum Windows Software
    Replies: 4
    Last Post: 23-05-2009, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,000,414.86323 seconds with 16 queries