Private Function ReadFile(ByVal filePath As String) Dim fs As IO.FileStream Dim br As IO.BinaryReader Dim bytes(10) As Byte Dim TheFile As String = "" Dim cutpath() As String = filePath.Split("\") fs = New IO.FileStream(filePath, IO.FileMode.Open, IO.FileAccess.Read) br = New IO.BinaryReader(fs) Dim byteRead As Byte Dim x As Integer For x = 0 To br.BaseStream.Length() - 1 byteRead = br.ReadByte TheFile += CStr(byteRead) Next br.Close() Return "!Binary!" & TheFile & "*" & cutpath(cutpath.Length - 1) MsgBox("!Binary!" & TheFile & "*" & cutpath(cutpath.Length - 1)) End Function
Private Sub SaveFile(ByVal TheBinaries As String) 'TheBinaires have Data*NameOfFile, this will seperate the two. Dim TheBin() As String = TheBinaries.Split("*") Dim fs As IO.FileStream Dim bw As IO.BinaryWriter fs = New IO.FileStream("d:\dounia\" & "copy_" & TheBin(1), IO.FileMode.CreateNew, IO.FileAccess.Write) bw = New IO.BinaryWriter(fs) bw.Write(TheBin(0)) 'bw.Write(byteRead) bw.Flush() fs.Close() bw.Close() End Sub
System.Net.Sockets
TcpListener/TcpClient
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)