简体   繁体   English

访问网络路径并将文件复制到系统= c#

[英]accessing network path and copy file to the system = c#

i want to create a small c# application. 我想创建一个小型的C#应用​​程序。 there is a text box and a button in form. 表单中有一个文本框和一个按钮。 if anyone enter a network path for a file and press the button, then the application must copy that file to a folder within that system. 如果有人输入文件的网络路径并按按钮,则应用程序必须将该文件复制到该系统内的文件夹中。 How can i do this.? 我怎样才能做到这一点。?

How to access a network path and how can i copy the file in that path to the system?? 如何访问网络路径,如何将该路径中的文件复制到系统?

You can use the OpenFileDilog class in .net to browse through the files. 您可以在.net中使用OpenFileDilog类浏览文件。

Also you can visit these links for Copy and other functionalities. 您也可以访问这些链接以获取复印和其他功能。

http://msdn.microsoft.com/en-us/library/cc148994.aspx http://msdn.microsoft.com/en-us/library/cc148994.aspx

http://msdn.microsoft.com/en-us/library/system.io.file.copy(VS.71).aspx http://msdn.microsoft.com/zh-CN/library/system.io.file.copy(VS.71).aspx

Net work paths are accessed by there full UNC ie \\Server\\Share\\drive\\file. 完整的UNC可以访问网络路径,即\\ Server \\ Share \\ drive \\ file。 As long as you have credentials to access them. 只要您具有访问它们的凭据即可。 You can use system.io.file.copy to move the files. 您可以使用system.io.file.copy移动文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM