开发者

Robust approach for copying or moving remote files from a .Net client?

I have a Windows service that monitors remote shares for job control and job output files and processes and moves files to archive folders.

My best solution so far is using methods available in the System.IO namespace (like Directory.Exists(), File.Move(), etc) to access and move these files.

The issue with this approach is that if the remote computer is not in a domai开发者_如何学Pythonn (which it is not), my service that performs these operations must run under a user account that also exists on the remote (Windows) computer, and the permissions must be set accordingly for the share and the file system objects on both the remote and the local computers.

I am concerned about issues that might arise down the road if the environment changes because people are not aware of these dependencies. I'd much rather build a more robust solution. Do you have suggestions?


You would map the network path by using NetUseAdd, WNetAddConnection2 one of the variants.

http://pinvoke.net/default.aspx/netapi32.NetUseAdd

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜