We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
如果您必须使用 HttpWebRequest 并假设您的输入数据流不大,您可以通过这样做使上传过程异步。请注意,BeginGetResponse 是实际打开与远程服务器的连接并处理上传的内容。
If you have to use HttpWebRequest and assuming your input data stream is not large you can make the upload process Async by doing this. Notice the BeginGetResponse is what actually opens the connection to the remote server and processes the upload.
它必须是
HttpWebRequest
吗?您可以使用WebClient
对象轻松完成此操作Does it have to be a
HttpWebRequest
? You can do this very easily with theWebClient
object