タイトル | : winsock(現状) |
記事No | : 13438 |
投稿日 | : 2009/02/18(Wed) 15:16 |
投稿者 | : JT |
win_sendのエラーになりうまく行きません><
Option Explicit Dim intGetId As Integer Dim intGetPort As Integer Dim strMaxData As String Dim intGetData As Integer Dim intLoop As Integer Dim intConnectMax As Long
Private Sub Cmd1_Click() Win_Send.RemoteHost = Txt2.Text Win_Send.RemotePort = Txt3.Text Win_Send.Protocol = sckTCPProtocol Win_Send.Connect Txt2.Text, Txt3.Text End Sub
Private Sub Cmd2_Click() Win_Recv.LocalPort = Txt3.Text Win_Recv.Listen Cmd2.Enabled = False End Sub
Private Sub Cmd3_Click() Win_Send.SendData Txt1.Text End Sub
Private Sub Cmd4_Click() Win_Recv.Close Win_Send.Close End Sub
Private Sub Form_Load() Form1.Caption = "winsock" Win_Recv.LocalPort = "0" Win_Send.LocalPort = 0 Win_Send.Protocol = sckTCPProtocol Win_Recv.Close Win_Send.Close
End Sub
Private Sub Win_RecvConnectionRequest(Index As Integer, ByVal requestID As Long) Win_Recv.Accept requestID End Sub
Private Sub Win_RecvDataArrival(Index As Integer, ByVal bytesTotal As Long) Win_Recv.SendData Txt1.Text Win_Recv.GetData strMaxData End Sub Private Sub Win_SendDataArrival(ByVal bytesTotal As Long) Win_Send.GetData strMaxData Txt1.Text = strMaxData End Sub
Private Sub Win_Recv_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) MsgBox "Recv_Error" End Sub
Private Sub Win_Send_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean) MsgBox "Send_Error" End Sub
|