gpt4 book ai didi

.net - 如何在 vb.net 中通过 HTTP post 发布文件

转载 作者:技术小花猫 更新时间:2023-10-29 12:29:20 25 4
gpt4 key购买 nike

在 vb.net 中通过 HTTP post 发送文件时出现问题。我试图模仿以下 HTML,以便 vb.net 做同样的事情。

<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 脚本。

如果是这样,这应该对你有用

Using wc As New System.Net.WebClient()
wc.UploadFile("http://yourserver/cgi-bin/upload.cgi", "c:\test.bin")
End Using

关于.net - 如何在 vb.net 中通过 HTTP post 发布文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/981354/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com