Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Communication in VB.net


BluePain's Avatar
Member
0 0

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:

www.cookiefi.net/etheral.zip


ghost's Avatar
0 0

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.


BluePain's Avatar
Member
0 0

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 :)


ghost's Avatar
0 0

well it is actually coded in vb not vb.net i just realized you are coding .net but do you still want to see the code?


BluePain's Avatar
Member
0 0

Yes, why not. It cant be that hard to convert it to vb.net, and I will see what it is like to do it in a nother languae and that cant be bad. It is better to se one thing frome more then one angel… And thanks for the help :)


ghost's Avatar
0 0

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.


BluePain's Avatar
Member
0 0

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?


BluePain's Avatar
Member
0 0

Oh I forgot to ask… Witch VB is it written in? vb 6, 5 ,4 ect…


BluePain's Avatar
Member
0 0

Oh I forgot to ask… Witch VB is it written in? vb 6, 5 ,4 ect…