 |
|
 |
I have also only see the User System. Can anybody help me to display the username how have delete or change any files. And what must i do to dont display delete *.tmp or other temporär Files
Thanks Holger
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I added a simple win form project with a button. Added a reference to FileSysWatcher service. In the button click event I have:
PrintReport.Print(); The problem:
I can not get past this line: string logFilePath = Util.GetSetting("LOGFILENAME"); Any thoughts? Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Whenever I start the service it stops with an IO Exception. The Service's ErrorLogFile file cannot be accessed because the Service is using it?
Service cannot be started. System.IO.IOException: The process cannot access the file 'C:\FileSysWatcher\ErrorLogFile\Log.txt' because it is being used by another process. at FileSysWatcher.Util.WriteToErrorLogFile(Exception sourceException) at FileSysWatcher.FileSysWatcher.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Please try this fs = new FileStream("Log.txt", FileMode.OpenOrCreate | FileMode.Append, FileAccess.Write, FileShare.Write);
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I think this will solve your problem http://bloggingabout.net/blogs/jschreuder/archive/2006/07/06/12886.aspx
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hey I created a setup file and installed on my desktop. As you said there are no .html files created. Instead there are two log file with .txt extension are created. The log file doesn't show me the messages ...like when i created a new folder and edited few files in other folder........these events were not recorded in the log file. Can you upload your updated code once again or can you email me to santu.kandhukuri@gmail.com
thanks santosh
san
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I am using this utility to copy one file from one folder to another on different server where we are using load balancing. For example i have two folders: FolderA (on ServerA) and FolderB (on ServerB). One of my application sends a file to FolderA which is my path to watch and then instantly it copies over to FolderB which is my Destination. File name would be the same every time i send it to FolderA how ever it would have different content, I want to replace existing file with new one one and replace it on FolderB as well. Please advice.
Thanks Ronnie
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
I have a problem relating to Windows Services and FileSystemWatcherClass of .NET.
I developed a windows service to monitor a specific folder on a server for changes and maintains its updated back up in another folder.
FileSystemWatcherClass is inherited to monitor and create mirror of a folder. It is available at http://www.codeproject.com/cs/files/directorymirror.asp?msg=1801877.
However, I found a limitation of this application. When copying large data (10 – 15 MB) it misses many events and only copies about half of the data. (This problem is also referred in the comments of the above article).
Possible cause of the problem: When you copy or drop large amounts of data somewhere it can take several seconds for the system to write the data to the disk. The system cannot send feedback about the status of the operation (completed, failed, queued, etc) while it is performing it or while it is queued, and during this time other requests to the file system are queued by the system. This is what I think is the source of the problem: The FileSystemWatcher has no patience and throws an exception if it doesn’t get an IMMEDIATE response from the file system. So any big operation that takes a bit of time will end up throwing an exception and often but not always, cause the operation to abort. This class seems to be completely ignorant of how the windows file system works.
I found a solution to that on msdn, that says increase the INTERNALBUFFERSIZE. The Windows operating system notifies your component of file changes in a buffer created by the FileSystemWatcher. If there are many changes in a short time, the buffer can overflow. This causes the component to lose track of changes in the directory, and it will only provide blanket notification.
This solution resolved the problem somehow. I increased buffer to 64KB (default is 8192 bytes). This successfully copied data up to 35MB without missing a single file and suffices to my needs.
The problem is, when I integrated this into a Windows Service, it all failed to copy even 3 – 4 MB of Data. I have searching a lot but haven’t found the right solution yet.
I would be grateful if somebody could help me out with that. Thanks a lot for your patience of reading a long mail.
regards,
Fayyaz Khan Lodhi fayyaz.lodhi@confiz.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
If you are trying to monitor a folder on a network drive, and attempting to access it using a mapped drive letter (eg t:\watchedFolder\) then this won't work when running as a service. You can't use mapped drive letters in a service, you must use the uri eg \\yourServername\...\watchedFolder\).
Robert Pocklington netWealth robert@netwealth.com.au
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
I have your project up and running ok but I have noticed that when I copy and paste files into a directory that is monitored, the service seems to be logging 3 changes in addition to the file creation, so in the log file I get :
8252110i.04.gif,C:\Test\dir1\image1.04.gif,Created,guestd,01/11/2006,15:31:03.5084857 8252110i.04.gif,C:\Test\dir1\image1.04.gif,Changed,guestd,01/11/2006,15:31:03.5241093 8252110i.04.gif,C:\Test\dir1\image1.04.gif,Changed,guestd,01/11/2006,15:31:03.5553565 8252110i.04.gif,C:\Test\dir1\image1.04.gif,Changed,guestd,01/11/2006,15:31:03.5866037 dir1,C:\Test\dir1,Changed,guestd,01/11/2006,15:31:03.6178509
Is there a way to get the service to ignore these extra events?
Dave
|
| Sign In·View Thread·PermaLink | 2.33/5 (3 votes) |
|
|
|
 |
|
|
 |
|
 |
When I open the solution it complains about not finding "testproject.csproj". It is not there. what gives?
|
| Sign In·View Thread·PermaLink | 1.33/5 (3 votes) |
|
|
|
 |
|
 |
Mine is also same problem. When I open the solution it complains about not finding "testproject.csproj". Can anyone reslove it???
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
My problem is to catch the user (window user) that modify a file . From the introduction of your article it seem's possible but actually the username displayed is the username of who started the watcher.
Vice
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
This code does not reveal the username who has performed the operation. It will always return NT AUTHORIY\SYSTEM.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I haven't found a good way to do it either. You can see this information if you turn on file/folder auditing and monitor the security event log. But to use this info you would have to monitor the eventlog for changes and then try to correlate this with the filesystem changes and that sounds like a real pain to code.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
the FileSystemWatcher can only watch for changes. Do you know how to get notified while a file is opened?
thanks.
|
| Sign In·View Thread·PermaLink | 2.60/5 (5 votes) |
|
|
|
 |
|
 |
Hi, I wonder if i can catch a which application that create, delete ... files in a directory
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
sorry for the late reply...i did not get your question....are you trying to ask if you can fnd out in which application the file was deleted....is this to track malacious code.....
Thanks and Regards. Prashant Bhide. System Analyst Nihilent Technologies Phone No.: +91 20 2605 2253 Mobile : +91 98229 76652 Email: p.bhide@nihilent.com 1st Floor, Amar Avinash Corporate City, 11, Bund Garden Road, Pune 411 001 " Technical Skill is the mastery of complexity, while Creativity is the mastery of simplicity."
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Sorry for my simply question, my mean is : i have a program A.exe and it delete a file test.txt in directory D. And when A.exe delete test.txt i want to notify as report the file test.txt is deleted and the program A.exe deleted it. Thanks for your time NThevu
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You surely will get notified when A.exe deletes the file test.txt. I don't think you will know that it was A.exe that deleted it, however.
Paolo del Mundo
Paolo del Mundo Software Engineer Anystream http://delmundo.squarespace.com
|
| Sign In·View Thread·PermaLink | 3.33/5 (3 votes) |
|
|
|
 |