English 中文(简体)
使用文件SystemWatcher监控名录
原标题:Watching a directory using FileSystemWatcher

Hello I m 观看使用FileSystemWatcher的名录。

When a file is created into that directory - my watcher grabs and transfers it to the network drive. My problem is that when a Microsoft-office file is opened, a temporary file is created in the watched directory. I can t find a way to ignore these files and also could not find when I should move these file to the network drive.

问题回答

Temporary files have file attribute that cite it. You can check for this attribute if the FileInfo.Attributes

http://msdn.microsoft.com/en-us/library/system.io.fileattributes%28v=VS100%29.aspx”rel=“nofollow noreferer”>FileAttributes

如果我不错,这些临时档案是隐藏的档案。 如果做不到这一点,你可能会考虑允许有特殊名称的档案(这些临时档案从til开始)被你的方案忽视。 定期使用 表达你可以像这样制造更多的“隐蔽”。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签