Communication in VB.net
Hello I am trying to make a program that can make a communication port between 2 computers on a LAN. You have 2 files A sender and a reciver. It works. But when I open it there comes a funny error that says there have been some conflict. So if somone could help me with this I would be greatefull. And yes, there are one more thing. I would like the sender program to send comands to the computer that have the reciver on. So if I would like to open a MsgMessage on the other computer that say hello. So would it open. It are a one way pro that only send commands. Because I havent had time to make it work two way. So if any one are kind enough help me.
Here is the files in a .zip map I contens may proscejt for the reciver and the sender:
chislam wrote: well i dont feeling like dl'ing it however, i have one of these already made. I am assuming you are using Winsock, yes? if not i can't help ya really.
Yes, I am using winsock. But you did say that you have made one of these allready. If I could have a look at your code. (I dont mean to be roude (is that right spelled? I am not so good at english) I would be wery thanks fuly for that) Would that be some big help for me so I have somthing to go after. But if I cant I respect that . And thanks for your helping :)
here is the server side -
Private Sub Form_Load() Winsock2.LocalPort = "166" Winsock2.Listen End Sub Private Sub Command1_Click() Winsock2.Connect Text3, "165"
End Sub
Private Sub Command4_Click() Data = Text1.Text & ": " & Text2.Text List1.AddItem (Data)
Winsock2.SendData Data Text2.Text = "" End Sub
Private Sub Command6_Click() Winsock2.Close
End Sub
Private Sub winsock2_dataarrival(ByVal bytestotal As Long) Dim cht As String Winsock2.GetData cht, vbString List1.AddItem (cht) End Sub
here is the client side
Private Sub Command1_Click() Dim chat As String chat = Text1.Text List1.AddItem (chat) Winsock2.SendData chat Text1.Text = ""
End Sub
Private Sub Form_Load() Winsock2.LocalPort = "166" Winsock2.Listen End Sub
Private Sub winsock2_connectionrequest(ByVal idrequest As Long) Winsock2.Close Winsock2.Accept idrequest End Sub Private Sub winsock2_dataarrival(ByVal bytestotal As Long) Dim cht As String Winsock2.GetData cht, vbString List1.AddItem (cht)
End Sub
It might not work how it is right now because i was messing around with it. it pretty much just sends messages back and forth tho.
chislam wrote: here is the server side -
Private Sub Form_Load() Winsock2.LocalPort = "166" Winsock2.Listen End Sub Private Sub Command1_Click() Winsock2.Connect Text3, "165"
End Sub
Private Sub Command4_Click() Data = Text1.Text & ": " & Text2.Text List1.AddItem (Data)
Winsock2.SendData Data Text2.Text = "" End Sub
Private Sub Command6_Click() Winsock2.Close
End Sub
Private Sub winsock2_dataarrival(ByVal bytestotal As Long) Dim cht As String Winsock2.GetData cht, vbString List1.AddItem (cht) End Sub
here is the client side
Private Sub Command1_Click() Dim chat As String chat = Text1.Text List1.AddItem (chat) Winsock2.SendData chat Text1.Text = ""
End Sub
Private Sub Form_Load() Winsock2.LocalPort = "166" Winsock2.Listen End Sub
Private Sub winsock2_connectionrequest(ByVal idrequest As Long) Winsock2.Close Winsock2.Accept idrequest End Sub Private Sub winsock2_dataarrival(ByVal bytestotal As Long) Dim cht As String Winsock2.GetData cht, vbString List1.AddItem (cht)
End Sub
It might not work how it is right now because i was messing around with it. it pretty much just sends messages back and forth tho.
Thanks that really helped… Thanks for all your help. :D Is there sombody else that have an ide?