关于VB6.0用Winsock处理返回的数据包的问题!!!
本帖最后由 hack_bxc 于 2011-10-31 21:32:07 编辑 先上代码:
Dim ip As String
Dim port As Integer
Dim bao(23) As Byte, receive() As Byte
Sub Command1_Click()
bao(0) = &HFF
bao(1) = &HFF
bao(2) = &HFF
bao(3) = &H54
bao(4) = &H53
bao(5) = &H6F
bao(6) = &H75
bao(7) = &H72
bao(8) = &H63
bao(9) = &H65
bao(10) = &H20
bao(11) = &H45
bao(12) = &H6E
bao(13) = &H67
bao(14) = &H69
bao(15) = &H6E
bao(16) = &H65
bao(17) = &H20
bao(18) = &H51
bao(19) = &H75
bao(20) = &H65
bao(21) = &H72
bao(22) = &H79
Winsock1.SendData bao
End Sub
Sub Command2_Click()
ip = Text_ip.Text
port = Text_port.Text
Winsock1.Connect ip, port
Command2.Enabled = False
End Sub
Sub Winsock1_Close()
Command1.Enabled = False
Command2.Enabled = True
End Sub
Sub winsock1_connect()
Command1.Enabled = True
Command2.Enabled = False
End Sub
Sub winsock1_dataarrival(ByVal bytestotal As Long)
Winsock1.GetData receive
Text1.Text = Chr(receive(4))
End Sub
想在Text1中显示receive(4)
怎么弄?用的是UDP协议.
麻烦高手们帮帮我.我是新手.
谢谢了.
[解决办法]
我就是想写一个查看CS服务器状态的程序.
这是两个相关的文章:
http://zhidao.baidu.com/question/118636687.html?fr=qrl&cid=93&index=1&fr2=query
http://banchen.bokee.com/6772048.html
我QQ:960537874