多谢!!!!!11

解决方案 »

  1.   

    http://www.fantasiasoft.net/Source/index.htm
    http://www.fantasiasoft.net/FileInfo/index.htm
      

  2.   

    是想将图片转成二进制码再用winsock控件从网上发到客户端
      

  3.   

    '先读后写:Private Sub Command1_Click()
    Dim n As Long
         Dim arrBytes() As Byte
         
         Open "c:\xxxx.bmp" For Binary As 1
         n = LOF(1)
         ReDim arrBytes(1 To n) As Byte
         Get 1, , arrBytes
         Close 1
         Open "c:\temp.bmp" For Binary As 1
            Put 1, , arrBytes
         Close 1
        MsgBox "ok"
         
    End Sub
      

  4.   

    我昨天才做好的用二进制发送接受文件的程序。发送的:
       Dim myfile() As Byte
       Dim position As Long
       Dim FileName As String
       
       FileName = txtaddress.Text
       position = FileLen(FileName)
       ReDim myfile(position - 1) As Byte
       
       Open FileName For Binary As #1
       Get #1, , myfile
       Close #1
       
       sockclient.SendData myfile接受的:
    Private lenth As Long      '已经收到的数据的长度,再添加时以这个长度为依据Private Sub sockserver_DataArrival(ByVal bytesTotal As Long)
       Dim receivefile() As Byte, i As Long
       ReDim receivefile(1 To bytesTotal)   '次处也可以是(0 To bytesTotal-1)   sockserver.GetData receivefile, vbArray + vbByte   Open "c:\a.bmp" For Binary As #1
          Put #1, lenth + 1, receivefile     
          Close #1
        
       lenth = lenth + UBound(receivefile) - LBound(receivefile) + 1
       
       txtmessage.Text = txtmessage.Text & Time & "收到数据" & Chr(13) & Chr(10)
       
    End Sub