1

你能帮我吗,我在上传图片到 imgur 时遇到问题。我尝试了 WebClient 和 HttpRequest 并且都返回了错误 Not Found。

  WebClient wc = new WebClient();
        wc.OpenWriteCompleted += new OpenWriteCompletedEventHandler(wc_OpenWriteCompleted);
        Uri u = new Uri("http://api.imgur.com/2/upload");
        wc.OpenWriteAsync(u, null, new object[] { imageData, byteread }); // Upload the file to the server
    }

    void wc_OpenWriteCompleted(object sender, OpenWriteCompletedEventArgs e) // The upload completed
    {
        if (e.Error == null)
        {
            Console.WriteLine(e.Result);
        }
    }
4

0 回答 0