远程服务器返回错误:(404)Not Found

时间:2012-06-27 12:55:48

标签: c#-4.0

我想将文件上传到https服务器 我写了下面的代码来上传文件到https服务器。 但它给出错误:

  

远程服务器返回错误:(404)Not Found。

我的代码如下。检查代码中有什么问题?

       try
        {
            using (WebClient webClient = new WebClient())
            {
                webClient.Credentials = new NetworkCredential(username, password);
                string filePath = filepath;
                webClient.UploadFile(@"https://us.itranscript.net:444/Upload/test.txt", "PUT", filePath);
                webClient.Dispose();
            }
        }
        catch (Exception err)
        {

        }

帮帮我

0 个答案:

没有答案
相关问题