报文vb.net代码,vb源代码

如何用vb.net获得网页的源代码

Dim url As String=" 网址"

为凤凰等地区用户提供了全套网页设计制作服务,及凤凰网站建设行业解决方案。主营业务为做网站、成都做网站、凤凰网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

Dim httpReq As System.Net.HttpWebRequest

Dim httpResp As System.Net.HttpWebResponse

Dim httpURL As New System.Uri(url)

httpReq = CType(WebRequest.Create(httpURL), HttpWebRequest)

httpReq.Method = "GET"

httpResp = CType(httpReq.GetResponse(), HttpWebResponse)

httpReq.KeepAlive = False ' 获取或设置一个值,该值指示是否与

Internet资源建立持久连接。

Dim reader As StreamReader = _

New StreamReader(httpResp.GetResponseStream,

System.Text.Encoding.GetEncoding(-0))

Dim respHTML As String = reader.ReadToEnd() 'respHTML就是网页源代码

vb代码翻译成vb.net代码

打开VS2005及以上版本,新建一个VB.NET语言的项目,然后点工具-升级VB6代码,把代码粘贴进去即可

求一个VB.NET进行局域网内UDP广播的源代码例子

给你个udp多播例子,广播不是很清楚,呵呵

Imports System.Net

Imports System.Net.Sockets

Imports System.Text

Public Class Form1

Inherits System.Windows.Forms.Form

Dim port As String

Dim ipadd As String

Dim ipend As IPEndPoint

Dim sendudp As New UdpClient()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles Button1.Click

Dim ipadress As IPAddress

ipadress = IPAddress.Parse(TextBox1.Text)

'sendport = Int32.Parse(TextBox2.Text)

'ipend = New IPEndPoint(ipadress, sendport)

Try

sendudp.JoinMulticastGroup(ipadress)

MessageBox.Show("启动完成!")

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

End Sub


文章名称:报文vb.net代码,vb源代码
本文URL:http://pwwzsj.com/article/hchosj.html