Hi
how do load the information to the new form when i click next in the previous form..
say i put my connection in the Module..
I pass the string of Xml tag at form1 to the module through send() method and receive the result to the MessageBox in form2 through receiveInfo() method in the module....
why is it that the messageBox i receive is blank without the string
"<Fruit> & vFruit & Name </Fruit>" in it....
how to link the Xml tag to the MessageBox in form2....
(Use MessageBox to simulate that it can receive and link to form2 when it start a new form)
Thanks..
In the previous form....
In the Module....Code:Private Sub btnNextActivity_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNextActivity.Click Dim s As String Dim dd As New form2 dd.Show() Connect() Name = "Apple" s = "<Fruit Type=" & """" & Name & """" & "</Fruit>" send(s) receiveInfo() Me.Hide() End Sub
Code:Public Name As String Public Sub send(ByVal s As String) Dim ascii As Encoding = Encoding.ASCII Dim networkStream As NetworkStream Try networkStream = tcpC.GetStream() Dim sendBytes As Byte() sendBytes = ascii.GetBytes(s) networkStream.Write(sendBytes, 0, sendBytes.Length) Catch ex As Exception Console.WriteLine("Sorry. This NetWorkStream is not connect to the server.") End Try End Sub Public Sub receiveInfo() Dim ascii As Encoding = Encoding.ASCII Dim networkStream As NetworkStream Try networkStream = tcpC.GetStream() Dim bytes(tcpC.ReceiveBufferSize) As Byte networkStream.Read(bytes, 0, CInt(tcpC.ReceiveBufferSize)) Dim ret As String = ascii.GetString(bytes) MessageBox.Show(ret) Catch Console.WriteLine("Sorry. This NetWorkStream is not connect to the server.") End Try End Sub




Reply With Quote