以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]WebBrowser控件能做post吗?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=122125)

--  作者:goodhawk
--  发布时间:2018/7/19 13:03:00
--  [求助]WebBrowser控件能做post吗?
使用WebBrowser 这个控件, 能做post数据的么,

是否是只能指定地址呢?

--  作者:有点甜
--  发布时间:2018/7/19 16:43:00
--  

具体一点你的问题。

 

webbrowser是显示网页的,你可以对里面的网页任意的操作控制,模拟提交也是可以的。


--  作者:goodhawk
--  发布时间:2018/7/19 17:02:00
--  
http://192.168.3.103:8080/api/v1/image/view?images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random&images=https://unsplash.it/400/800/?random

对方要求我这边: 通过post的方法提交到他那边, 传入的参数的 images=http://xxxxx/xxx/1.jpg

然后再通过 WebBrowser 访问 http://192.168.3.103:8080/api/v1/image/view 就可以看到最新的展示

--  作者:有点甜
--  发布时间:2018/7/19 17:40:00
--  

你问问能否get请求,这样你方便很多。你直接写代码如这样即可

 

Dim url As String = "http://xxx/xxx/1.jpg"

e.form.controls("webbrowser1").address = "http://192.168.3.103:8080/api/v1/image/view?images=" & UrlEncode(url)

[此贴子已经被作者于2018/7/19 17:39:55编辑过]

--  作者:goodhawk
--  发布时间:2018/7/19 18:15:00
--  
不行, 由于要传送的images比较多,而且每个images的地址也比较长
--  作者:有点甜
--  发布时间:2018/7/19 20:13:00
--  

那你做一个网页,提交表单,网页类似这样做

 

http://www.w3school.com.cn/html/html_forms.asp

 

然后webbrowser显示这个网页,提交这个网页,即可。

[此贴子已经被作者于2018/7/19 20:13:29编辑过]