Dim client As New TcpClient("127.0.0.1", 10000)
Dim ns As NetworkStream = client.GetStream
Dim xDoc As XmlDocument
xDoc = New XmlDocument
xDoc.Load("C:\Inetpub\wwwroot\Sockets\Request01.xm l")
If ns.CanRead And ns.CanWrite Then
Dim sendBytes As Byte() = Encoding.UTF8.GetBytes(xDoc.OuterXml)
ns.Write(sendBytes, 0, sendBytes.Length)
Dim responseBytes(client.ReceiveBufferSize) As Byte
ns.Read(responseBytes, 0, CInt(client.ReceiveBufferSize))
Dim xResponse As XmlDocument
xResponse = New XmlDocument
xResponse.LoadXml(Encoding.UTF8.GetString(response Bytes))
Dim ns As NetworkStream = client.GetStream
Dim xDoc As XmlDocument
xDoc = New XmlDocument
xDoc.Load("C:\Inetpub\wwwroot\Sockets\Request01.xm l")
If ns.CanRead And ns.CanWrite Then
Dim sendBytes As Byte() = Encoding.UTF8.GetBytes(xDoc.OuterXml)
ns.Write(sendBytes, 0, sendBytes.Length)
Dim responseBytes(client.ReceiveBufferSize) As Byte
ns.Read(responseBytes, 0, CInt(client.ReceiveBufferSize))
Dim xResponse As XmlDocument
xResponse = New XmlDocument
xResponse.LoadXml(Encoding.UTF8.GetString(response Bytes))
No comments:
Post a Comment