谢谢!

解决方案 »

  1.   

    怎么发送字符串就怎么发送byte()2个操作是一样的,不明白你什么意思
      

  2.   

    如果发送缓冲是TxBuf(0 to N),发送长度是Total(total < N)
    发送前
    dim Buf() as byte
    dim sData as variant
    redim Buf(0 to Total - 1)
    for i = 0 to total - 1
        buf(i) = txbuf(i)
    next i
    sdata = buf
    winsock.senddata sdata
      

  3.   

    Private Sub Command1_Click()
    Dim a(3) As Byte
    Dim ss As String * 4
    ss = "ABCD"
            Call CopyMemory(a(0), ss, 4)
            Winsock1.SendData a
    End Sub
      

  4.   

    Client:
    dim ByteArray() as byte
    openfile FileName, ByteArray()'读取文件函数(自行编写)
    tcpClient.SendData ByteArray()'发送Server:
    tcpServer.GetData ByteArray(), vbByte'接收
    writefile FileName,Bytearray()'写文件函数(自行编写)