110,530
社区成员
发帖
与我相关
我的任务
分享
try
{
using (WebClient IR = new WebClient())
{
IR.Credentials = new NetworkCredential("username", "pwd", "域名");
IR.UploadFile(@"http://sitename/file/filename.xml", "put", @"F:\File\filename.xml");
}
}
catch (System.Net.WebException webex)
{
MessageBox.Show("Update File Error(System.Net.WebException):" + webex.Message.ToString());
}
catch (Exception ex)
{
MessageBox.Show("Update File Error(System.Exception):" + ex.Message.ToString());
}