将文件存入远程目录 [英] deposit files into a remote directory
本文介绍了将文件存入远程目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c#将文件存入远程目录?
How does one deposit files into a remote directory using c#?
推荐答案
取决于它是如何远程的:如果它在同一个局域网上,那么你可以只访问共享并(假设您具有必要的权限)编写文件: http://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a- network-share / 1197430#1197430 [ ^ ]
如果是基于互联网的存放处,那么你最好的解决方案可能是FTP:简单的C#FTP类 [ ^ ]
Depends on how "remote" it is: if it's on the same LAN, then you can just access the share and (assuming you have the requisite permissions) write the files: http://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a-network-share/1197430#1197430[^]
If it's an internet based depository, then your best solution is probably FTP: Simple C# FTP Class[^]
从哪里获取文件?
你能不能只做一个File.Copy(@C:\ your_source_file.txt,@\\\\\\\\\\\\\\\\\\\\\\\\\\ .txt);
of File.Move(来源,目的地);
Where are you getting the files from?
Can you not just do a File.Copy(@"C:\your_source_file.txt",@"\\server\share_name\your_remote_file_name.txt");
of File.Move(source,destination);
这篇关于将文件存入远程目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文