Private Sub Winsock_DataArrival(ByVal bytesTotal As Long)
Static strData, strSend As Byte
Winsock.GetData strData, vbString
RichTextBox1.Text = RichTextBox1.Text & strData
RichTextBox1.SelStart = Len(RichTextBox1.Text)
End Sub
12 个解决方案
#1
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) Dim strData() As Byte Dim f As Integer ReDim strData(bytesTotal-1) Winsock.GetData strData, vbByte f=FreeFile() open "data" for append as #f print #f,StrConv(strData,vbUnicode) close #f ' RichTextBox1.Text = RichTextBox1.Text & StrConv(strData,vbUnicode) ' RichTextBox1.SelStart = Len(RichTextBox1.Text)
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) dim strData() as byte ReDim strData(bytesTotal-1) Winsock.GetData strData, vbbyte RichTextBox1.Text = RichTextBox1.Text & strconv(strData,vbUnicode) RichTextBox1.SelStart = Len(RichTextBox1.Text) erase strData End Sub
Private Const WM_USER = &H400 Private Const EM_EXSETSEL = (WM_USER + 55) Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_VSCROLL = &H115 Const SB_BOTTOM = 7 Const WM_KEYDOWN = &H100 Const VK_LEFT As Long = &H25
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) Dim strData() As Byte Dim f As Integer ReDim strData(bytesTotal-1) Winsock.GetData strData, vbByte f=FreeFile() open "data" for append as #f print #f,StrConv(strData,vbUnicode) close #f ' RichTextBox1.Text = RichTextBox1.Text & StrConv(strData,vbUnicode) ' RichTextBox1.SelStart = Len(RichTextBox1.Text)
Private Sub Winsock_DataArrival(ByVal bytesTotal As Long) dim strData() as byte ReDim strData(bytesTotal-1) Winsock.GetData strData, vbbyte RichTextBox1.Text = RichTextBox1.Text & strconv(strData,vbUnicode) RichTextBox1.SelStart = Len(RichTextBox1.Text) erase strData End Sub
Private Const WM_USER = &H400 Private Const EM_EXSETSEL = (WM_USER + 55) Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_VSCROLL = &H115 Const SB_BOTTOM = 7 Const WM_KEYDOWN = &H100 Const VK_LEFT As Long = &H25