Code to monitor server for new files - windows

Anybody have some code to monitor a windows server and notify me when a new file has been copied to it.
Thanks,
Paul

Think you want FileSystemWatcher
msdn
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
example
https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-6165137.html
EDIT : .Net specific answer

Related

Cannot find ETW event ID/Name

I have created a Service Fabric Application from the visual studio wizard
This is mostly working, but the diagnostic events viewer is not working
This requires either an ETW Provider name or GUID
How do I find this?
I have tried the one shown in debug Arguments in the service fabric tools output and that doesnt work
I am running this as a development cluster at the moment
Paul
Found it but I am going to keep this question in case other people have the same problem
I did a search for EventSource and found
[EventSource(Name = "NAME IS HERE")]
In the ServiceEventSource.cs file
Using this works!
Paul

Monitor Hard drive for new files created

I am not sure if there is any utility which monitors hard drive for any new files getting created.
I am using one application that creates many files on my hard drive but I am not sure how can I monitor those newly created files.
BTW I am using Windows VISTA x64 machine.
Thanks in advance !
In native code, use a directory change notification.
If you prefer .net, then use FileSystemWatcher.
If you are a programmer and know Python, you should check https://fascinator.usq.edu.au/trac/wiki/Watcher
It monitors folders/directory for file changes i.e. created, deletion, modification.
If you are a Java Programmer, you should check WatchService in JDK 7. http://download.oracle.com/javase/tutorial/essential/io/notification.html
Check out the FileSystemWatcher class. It will help you by notifying you when something in a particular directory has changed.

FTP client that functions similarly to Dropbox?

I'm trying to help a wonderful designer who is sadly running out of space on her Dropbox, but is already paying for hosting service that has 100GB available for her. Is there a software that works and that is seamlessly integrated within explorer and updates files on FTP that you yourself can assign?
Thanks!
What you are looking for is something like FTPBox http://ftpbox.org/
Hell in your case Id consider buying a NAS drive :)
QNAS make about the best on the market, they can be rigged up as ftp servers, have almost a terabyte space, allow for windows and linux integration and make brilliant samba servers.
It all depends on your requirements, which you have not stated too clearly.
Do you want Internet storage (web/dav/ftp/sftp) or storage within your own network?
If you are looking for a solution which is available for almost every OS and where the storage is located somewhere in our wonderful Internet-verse, webdav/s could be the solution.
I'm not really sure, if I understand the statement "files on FTP that you yourself can assign".
Please be a little bit more specific.
Why not Filezilla?
http://filezilla-project.org/
You can try IQBox, my own free open-source project. It syncs using FTP-SSL by default (you can use non-SSL FTP also, but not recommended due to security.) It's a simple sync app for FTP.
Official Download Page for IQBox FTP Client
Google Code Project Page
If they are using Windows they can set up an FTP account as a "Network Location", then you can use it like a regular folder on your PC. Drag and drop away.
http://windows.microsoft.com/en-us/windows/work-with-files-ftp-site#1TC=windows-7

Managing a remote Windows Service

As part of my app, my users install a Window Service (msi file written in C#) that uploads data to me. These Windows servers are usually behind all kinds of firewalls etc. and run by IT staff so it's difficult to get in touch with anyone to debug.
What can I put inside my application that would make it easier to figure out things? I'm not looking to do anything that would be considered "shady" but here are some ideas I've thought:
Open log files that are relevant to me in a separate thread and stream it back up to the server
Setup some kind of reverse tunnel (not sure if there is a sane shell environment on Windows that I can connect to)
Any ideas or thoughts would be appreciated.
The author of the logging framework we use (the object guy's) has a service that might be useful for you.
You can debug .NET and native code through remote debugger with Visual Studio, see the post of John Robbins about it : http://www.wintellect.com/CS/blogs/jrobbins/archive/2010/06/15/vs-remote-debugging-across-workgroups-or-domains.aspx

What is the MS Win32 API to know a folder is shortcuts?

In Vista and Windows 7, there are many folders are shortcuts, like "C:\Users\Administrator\Application Data", use FindFileFirst serial API can enumerate all files under the folder, however we can NOT open it in Windows Explorer, I will also get error while call CreateFile to open the folder or the file enumerated by FindFileFirst serial API. I want to know what is the MS Win32 API to know a folder is shortcuts? Is FILE_ATTRIBUTE_REPARSE_POINT flag using for this kind of folder?
Hm looks as if there is not API there to check that.... I may be wrong of course
here's has someone written about it's format:
http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf
so maybe opening the file and finding the GUID is what you have to do?
Regards
Friedrich
I have known the answer, see on this blog.
http://blogs.msdn.com/oldnewthing/archive/2004/12/27/332704.aspx

Resources