这个方法在IE的代理服务器设置之前是可以用的,一旦设置了IE的代理就不行了。应该是UploadFile用了IE的代理吧。不知道这个设置在哪能设置?
谢谢! private static void Upload(string ftpServer, string userName, string password, string filename)
{
using (System.Net.WebClient client = new System.Net.WebClient())
{
client.Credentials = new System.Net.NetworkCredential(userName, password);
string name="ftp://"+ftpServer + "//" + new FileInfo(filename).Name;
client.UploadFile(name ,filename); }
}
谢谢! private static void Upload(string ftpServer, string userName, string password, string filename)
{
using (System.Net.WebClient client = new System.Net.WebClient())
{
client.Credentials = new System.Net.NetworkCredential(userName, password);
string name="ftp://"+ftpServer + "//" + new FileInfo(filename).Name;
client.UploadFile(name ,filename); }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货