如何发布通过HTTP POST文件在vb.net [英] How to post a file via HTTP post in vb.net
本文介绍了如何发布通过HTTP POST文件在vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有通过HTTP发布在vb.net中发送一个文件有问题。我试图模仿下面的HTML所以vb.net做同样的事情。
Having a problem with sending a file via HTTP post in vb.net. I am trying to mimic the following HTML so the vb.net does the same thing.
<form enctype="multipart/form-data" method="post" action="/cgi-bin/upload.cgi">
File to Upload:
<input type="file" name="filename"/>
<input type="submit" value="Upload" name="Submit"/>
</form>
希望有人能帮助!
Hope someone can help!
推荐答案
我想你问的是什么来发布文件,从VB.Net WinForms应用程序的Web服务器的CGI脚本的能力。
I think what you are asking for is the ability to post a file to a web server cgi script from a VB.Net Winforms App.
如果是这样的话,这应该为你工作。
If this is so this should work for you
Using wc As New System.Net.WebClient()
wc.UploadFile("http://yourserver/cgi-bin/upload.cgi", "c:\test.bin")
End Using
这篇关于如何发布通过HTTP POST文件在vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文