TCP/IP 通信示例

来源:互联网 发布:label mx 破解软件 编辑:程序博客网 时间:2024/04/20 06:56

TCP/IP 通信示例


Global String ReadData_P_All$, ReadData_P$(10), data$ 'Global Preserve Double xGlobal Integer foundnumber_PFunction TCPServer   SetNet #201, "192.168.0.1", 4000, CRLF, NONE, 0    OpenNet #201 As Client    WaitNet #201    Print "TCP Connected"     Integer i    Do         If ChkNet(201) > 0 Then  Line Input #201, ReadData_P_All$          Print "ReadData-p:", ReadData_P_All$          ParseStr ReadData_P_All$, ReadData_P$(), ","    foundnumber_P = UBound(ReadData_P$())      Print "foundnumber_P=", foundnumber_P, "RP", Len(ReadData_P_All$)    If ReadData_P$(UBound(ReadData_P$())) = "#" Then      For i = 0 To UBound(ReadData_P$())    ReadData_P$(i) = ""Next i      EndIf EndIfIf data$ <> "" ThenPrint #201, data$data$ = ""EndIf    LoopFend


0 0