Foxtable(狐表)用户栏目专家坐堂 → FT 调用webservice例子


  共有5658人关注过本帖树形打印复制链接

主题:FT 调用webservice例子

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/27 16:31:00 [显示全部帖子]

直接就行

 

Dim url As String = "http://www.foxtable.com"

Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)

Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse

Dim stm As System.IO.Stream = rsps.GetResponseStream()

Dim reader As New System.IO.StreamReader(stm)

Dim str As String = reader.ReadToEnd

rsps.Close
stm.Close
reader.close

msgbox(str)


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/27 16:41:00 [显示全部帖子]

Post的参考

 

Dim msg As String = ""

Dim req = System.Net.WebRequest.Create("http://www.shozaioh.com/member_login?email=qlc%40qlc.jp&passwd=qianqian&cmd=login")
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"
req.ContentLength = msg.Length

Dim pos = req.GetResponse

Dim stm As System.IO.Stream = pos.GetResponseStream()

Dim reader As New System.IO.StreamReader(stm)

Dim str As String = reader.ReadToEnd

pos.Close
stm.Close
reader.close

msgbox("成功")


 

 

----------------------------

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=54957&replyID=366223&skin=1

 

[此贴子已经被作者于2015/8/27 16:41:38编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/27 18:36:00 [显示全部帖子]

看楼上啊,已经很明显了啊。换个网址就行啊

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/28 9:15:00 [显示全部帖子]

以下是引用大红袍在2015/8/27 18:36:00的发言:
看楼上啊,已经很明显了啊。换个网址就行啊

 

+1


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/28 9:20:00 [显示全部帖子]

Dim msg As String = ""

Dim req = System.Net.WebRequest.Create("http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/getDatabaseInfo")
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"
req.ContentLength = msg.Length

Dim pos = req.GetResponse

Dim stm As System.IO.Stream = pos.GetResponseStream()

Dim reader As New System.IO.StreamReader(stm)

Dim str As String = reader.ReadToEnd

pos.Close
stm.Close
reader.close

msgbox(str)


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/28 10:00:00 [显示全部帖子]

mark post提交

 

Dim msg As String = "mobileCode=15091267272&userID="
Dim req = System.Net.WebRequest.Create("http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/getMobileCodeInfo")
req.Method = "POST"
req.ContentType = "application/x-www-form-urlencoded"

Dim aryBuf As Byte() = Encoding.GetEncoding("GB2312").GetBytes(msg)
req.ContentLength = aryBuf.Length
Dim writer = req.GetRequestStream()
writer.Write(aryBuf, 0, aryBuf.Length)
writer.Close()
writer.Dispose()

Dim pos = req.GetResponse
Dim stm As System.IO.Stream = pos.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim str As String = reader.ReadToEnd
pos.Close
stm.Close
reader.close

msgbox(str)

[此贴子已经被作者于2015/8/28 10:00:56编辑过]

 回到顶部