Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-06-2009
Member
 
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.....?
Reply With Quote
  #2  
Old 08-06-2009
Member
 
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.
Reply With Quote
  #3  
Old 08-06-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
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).
Reply With Quote
  #4  
Old 08-06-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: .net windows service c# filewatcher code

I am attaching some of the attachments here hope it works for you :
Reply With Quote
  #5  
Old 08-06-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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...!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: ".net windows service c# filewatcher code"
Thread Thread Starter Forum Replies Last Post
Getting error code 80073701 while installing Windows Service Pack 1 MossS Operating Systems 3 21-09-2011 07:37 PM
Windows Error Code - 8024002D - Windows XP Service Pack 3 cpellew Windows Update 5 26-03-2010 06:23 PM
Windows XP Service Pack 3 Error Code: 0x80070005 K. Becker Windows Update 7 10-03-2010 11:11 AM
Error Code 8024200d Windows Vista Service Pack 1 William Wade Vista Help 2 14-01-2010 09:46 PM
windows service pack error code 3701 Kurtz Windows Software 4 23-05-2009 02:15 PM


All times are GMT +5.5. The time now is 10:19 PM.