如何在 vb.net 中通过 HTTP post 发布文件 [英] How to post a file via HTTP post in vb.net
本文介绍了如何在 vb.net 中通过 HTTP post 发布文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 vb.net 中通过 HTTP post 发送文件时遇到问题.我试图模仿以下 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>
希望有人能帮忙!
推荐答案
我认为您要求的是能够将文件从 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: est.bin")
End Using
这篇关于如何在 vb.net 中通过 HTTP post 发布文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文