TcpClient
class for that. You call GetStream
and then you write to the Stream
. It's up to you to read the file in chunks and write those chunks to the Stream
, performing the progress calculation yourself as you go and displaying the result. Dim ns As NetworkStream
ns = cli.GetStream
Dim bytes() As Byte = New Byte(cli.ReceiveBufferSize - 1) {}
Dim i As Integer = 0
Do While cli.GetStream.DataAvailable = True
bytes(i) = cli.GetStream.ReadByte()
i += 1
'msg = System.Text.Encoding.ASCII.GetString(bytes, 0, i)
'Form3.ProgressBar1.Value = cli.Available / i * 100
Loop
TcpClient
, not sending data to one. You said that you want to send data. Which is it? You need to be clear in what question you're actually asking.i am sorryThat code is receiving data from aTcpClient
, not sending data to one. You said that you want to send data. Which is it? You need to be clear in what question you're actually asking.
Thank you, but I'm a student, I'm still learning, and I can't pay anyoneI'm at my desk, doing the work that I get paid for. If you expect someone to be at your beck and call then you probably ought to think about paying someone, rather than using public forums where people volunteer their time. I will address individual issues if and when I have the time and the inclination.