Torna al Thread

'//Info sulla macchina Dim moLocalIP = Dns.GetHostByName(Dns.GetHostName) Dim ip = moLocalIP.AddressList(0).ToString '// TcpClient per connessione moTcpClient = New TcpClient() moTcpClient.Connect(ip, 13000) If moTcpClient.GetStream.CanWrite Then ''Apro il file da mettere a disposizione per la sockets Dim FileInvio As New IO.FileStream("C:\prova\File.txt", IO.FileMode.Open, IO.FileAccess.Read) Dim buf(CInt(FileInvio.Length)) As Byte Dim iRet As Int32 = FileInvio.Read(buf, 0, buf.Length) 'Invio file moTcpClient.GetStream.Write(buf, 0, buf.Length) FileInvio.Close() End If End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5