控件下載地址:
創(chuàng)新互聯(lián)從2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目網(wǎng)站設(shè)計制作、成都網(wǎng)站設(shè)計網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元吉安做網(wǎng)站,已為上家服務(wù),為吉安各地企業(yè)和個人服務(wù),聯(lián)系電話:028-86922220
解壓縮后,根目錄為控件,子目錄為控件運用的例子
控件說明:
====================
'可根據(jù)模式0(屬性Mode=0)獲得完整包數(shù)據(jù)(包括IP頭+TCP/UDP/ICMP頭+實際數(shù)據(jù))
'或模式1(屬性Mode=1)獲得網(wǎng)絡(luò)包中的實際數(shù)據(jù)(不包括IP頭、TCP/UDP/ICMP頭)
'屬性CatchIP為指定要捕捉的IP地址,若為空字符串則捕捉本網(wǎng)卡上可截獲的所有數(shù)據(jù)包(即流經(jīng)本網(wǎng)段所有數(shù)據(jù)包)
'只讀屬性LocalIP為本機IP地址,利用該屬性賦給CatchIP,實現(xiàn)僅捕捉本機IP數(shù)據(jù)
'屬性Begin為Boolean類型,當(dāng)設(shè)為True時開始抓包,當(dāng)設(shè)為False則停止抓包
'方法GetIPHeader用于從指定的完整包數(shù)據(jù)中提取IP頭部數(shù)據(jù)
'方法GetTCPHeader用于從指定的完整包數(shù)據(jù)中提取TCP頭部數(shù)據(jù)
'方法GetUDPHeader用于從指定的完整包數(shù)據(jù)中提取UDP頭部數(shù)據(jù)
'方法GetICMPHeader用于從指定的完整包數(shù)據(jù)中提取ICMP頭部數(shù)據(jù)
'方法GetData用于從指定的完整數(shù)據(jù)包中獲得實際數(shù)據(jù)
'方法GetDataLen用于從指定的完整數(shù)據(jù)包中獲得實際數(shù)據(jù)長度
'方法GetIpStr用于轉(zhuǎn)換長整數(shù)型IP地址為字符串IP地址
'方法DataCopy用于復(fù)制字節(jié)數(shù)組指定位置開始的指定個數(shù)數(shù)據(jù)
'具有事件RecevAll(Mode=0時觸發(fā)此事件),通過參數(shù)提供網(wǎng)絡(luò)完整包數(shù)據(jù)(包括IP頭+TCP/UDP/ICMP頭+實際數(shù)據(jù))
'具有事件Recev(Mode=1時觸發(fā)此事件),通過參數(shù)提供網(wǎng)絡(luò)包中的實際數(shù)據(jù)(不包括IP頭、TCP/UDP/ICMP頭)
附件中包括CatchX控件源代碼以及一個利用此控件制作的Sniffer程序源代碼,該程序可以作為使用CatchX控件的樣例。
你提供的網(wǎng)頁如下圖了,你說導(dǎo)出數(shù)據(jù),到底導(dǎo)出什么數(shù)據(jù)????你一定要圖文并茂好好表述清楚自己的問題,否則大家難回答。
用 vb.net socket通信
Dim th As Threading.Thread
2 Dim tcpl As System.Net.Sockets.TcpListener
3
4 Private Sub Form1_Load()Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
5 th = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf MyListen))
6 th.Start()
7 End Sub
8
9 Public Sub SendMessage()Sub SendMessage(ByVal IP As String, ByVal SendMsg As String)
10 Try
11 If IP "" Then
12 Dim tcpc As New System.Net.Sockets.TcpClient(IP, 5656)
13 Dim tcpStream As Net.Sockets.NetworkStream = tcpc.GetStream
14 Dim reqStream As New IO.StreamWriter(tcpStream)
15 reqStream.Write(SendMsg)
16 reqStream.Flush()
17 tcpStream.Close()
18 tcpc.Close()
19 End If
20 Catch ex As Exception
21 MsgBox(ex.Message.ToString)
22 End Try
23 End Sub
24 Private Sub MyListen()Sub MyListen()
25 Try
26 Dim ipAddress As System.Net.IPAddress = System.Net.Dns.Resolve(System.Net.Dns.GetHostName).AddressList(0)
27 tcpl = New System.Net.Sockets.TcpListener(ipAddress, 5656)
28 tcpl.Start()
29 While True
30 Dim s As System.Net.Sockets.Socket = tcpl.AcceptSocket()
31 Dim MyBuffer(1024) As Byte
32 Dim i As Integer
33 i = s.Receive(MyBuffer)
34 If i 0 Then
35 Dim lstrRec As String
36 Dim j As Integer
37 For j = 0 To i - 1
38 TextBox1.Text += Chr(MyBuffer(j)) ","
39 Next
40 End If
41 End While
42 Catch ex As Exception
43 MsgBox(ex.Message.ToString)
44 End Try
45 End Sub
46
47 Private Sub Button1_Click()Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
48 SendMessage("192.168.0.61", TextBox2.Text)
49 End Sub