无法使用webclient和httpwebrequest C#在webdav服务器上上传所有文件

时间:2013-04-09 13:55:01

标签: c# httpwebrequest webclient webdav

public int UploadFile(string url, string localFile,out string a_Error)
{
WebClient webClient = new System.Net.WebClient();
webClient.Proxy = null;

webClient.Credentials = new NetworkCredential(Credential.UserName, Credential.Password);
webClient.UploadFile(url, "PUT", localFile);
webClient.Dispose();
}

1 个答案:

答案 0 :(得分:-1)

尝试使用HttpWebRequest类。 以下是示例: First Second