Foxtable(狐表)用户栏目专家坐堂 → [求助]用UDPClient与网站通讯代码编写


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

主题:[求助]用UDPClient与网站通讯代码编写

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


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By:2016/11/20 9:28:00 [显示全部帖子]

参考代码

 

Dim xmlDoc As New System.XML.XmlDocument
xmlDoc.Load("d:\test.xml")
Dim ndList  = xmlDoc.GetElementsByTagName("PLANT")

For i As Integer = 0 To ndList.count - 1
    Dim COMMON As String = ndList(i).Item("COMMON").InnerText
    Dim BOTANICAL As String = ndList(i).Item("BOTANICAL").InnerText
    Dim ZONE As String = ndList(i).Item("ZONE").InnerText
   
    output.show(COMMON & " " & BOTANICAL & " " & ZONE)
Next


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


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By:2016/11/20 18:08:00 [显示全部帖子]

参考代码

 

Dim msg As String = ""
Dim req = System.Net.WebRequest.Create("http://www.w3school.com.cn/example/xmle/plant_catalog.xml")
req.Method = "get"

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

'output.show(str)
 

Dim xmlDoc As New System.XML.XmlDocument
xmlDoc.Loadxml(str)
Dim ndList  = xmlDoc.GetElementsByTagName("PLANT")

For i As Integer = 0 To ndList.count - 1
    Dim COMMON As String = ndList(i).Item("COMMON").InnerText
    Dim BOTANICAL As String = ndList(i).Item("BOTANICAL").InnerText
    Dim ZONE As String = ndList(i).Item("ZONE").InnerText
   
    output.show(COMMON & " " & BOTANICAL & " " & ZONE)
Next


 回到顶部