如何从服务器获取文件 [英] How to fetch files from server
本文介绍了如何从服务器获取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以通过使用下面的代码从本地计算机中获取文件,但是现在我想从服务器系统中获取文件
使用的命名空间:
使用System.IO;
我的代码:
字符串[] File1 = Directory.GetFiles("D:/Advertisements/Add1/");
任何人都可以帮助我
i can able to fetch files from my local computer by using the fallowing code but now i wanted to fetch the files from server system how to do that
namespace used:
using System.IO;
My code:
string[] File1 = Directory.GetFiles("D:/Advertisements/Add1/");
any one plz help me
推荐答案
只需使用共享的UNC路径访问该服务器.
而不是"D:/Advertisements/Add1/",您应该使用格式"\\ Server \ SharedFolder"或"\\ Server \ c
Simply use a shared UNC path to that server.
Instead of "D:/Advertisements/Add1/" you should use the format "\\Server\SharedFolder" or "\\Server\c
"来访问c的隐藏共享驱动器(如果您有足够的权限执行此操作.
祝你好运!
" to access the hidden share of the c drive (if you have enough permissions to do it.
Good luck!
这篇关于如何从服务器获取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文