访问服务器上使用 WebClient.UploadData 发送的确切数据
新手问题:我正在使用 WebClient.UploadData 方法将字节数组形式的大文本字符串发送到网站,但我不确定从服务器上的确切位置检索该数据。我读过一些帖子,说它位于我已经知道的请求对象中,但我到底如何检索我发送的特定字节数组,如以下 c# 伪代码所示:
byte[] dataSent = request.GettheByteArrayISentFromWebClientUploadDataMethod;
我知道它可能不像这个和那个那么简单我可能需要进行一些其他处理,但是任何人都可以发布一个代码片段来显示我如何获取发送的字节数组吗?
多谢多谢
Newbie question: I'm sending a large text string in the form of a byte array using the WebClient.UploadData method to a web site but I'm not sure exactly where to retrieve that data from on the server. I've read posts that say it is in the request object which I already know but how exactly do I retrieve the specific byte array I sent like in the following c# pseudo code:
byte[] dataSent = request.GettheByteArrayISentFromWebClientUploadDataMethod;
I understand that it may not be as simple as this and that I may need to do some other processing but can anyone post a code snippet that shows how I can get at the byte array that was sent?
Mucho Thank-you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试从请求流中读取它 Request.InputStream:
如果您要发送键/值对,则可以使用 UploadValues< /a> 方法并将它们简单地读取为请求参数:
Try reading it from the request stream Request.InputStream:
If you are sending key/value pairs then you could use the UploadValues method and read them simply as request paraneters: