| | |
Visual Basic 2008, Chat ! Urgent help needed
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
see this link :
http://www.vbdotnetforums.com/showthread.php?t=12469
http://www.vbdotnetforums.com/showthread.php?t=12469
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
there are code for this....
sorry if it can't help you.
sorry if it can't help you.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Oct 2007
Posts: 172
Reputation:
Solved Threads: 16
to do such thinks you must use sockets
try this
Imports System
Imports System.Net.Sockets
Imports System.IO
Public Class ServerSocket1
Public Shared Sub Main()
Try
Dim status As Boolean = True
Dim servermessage As String = ""
Dim clientmessage As String = ""
Dim tcpListener As New TcpListener(8100)
tcpListener.Start()
Console.WriteLine("Server Started")
Dim socketForClient As Socket = tcpListener.AcceptSocket()
Console.WriteLine("Client Connected")
Dim networkStream As New NetworkStream(socketForClient)
Dim streamwriter As New StreamWriter(networkStream)
Dim streamreader As New StreamReader(networkStream)
While status
If socketForClient.Connected Then
servermessage = streamreader.ReadLine()
Console.WriteLine("Client:" + servermessage)
If (servermessage = "bye") Then
status = False
streamreader.Close()
networkStream.Close()
streamwriter.Close()
Return
End If
Console.Write("Server:")
clientmessage = Console.ReadLine()
streamwriter.WriteLine(clientmessage)
streamwriter.Flush()
End If
End While
streamreader.Close()
networkStream.Close()
streamwriter.Close()
socketForClient.Close()
Console.WriteLine("Exiting")
Catch e As Exception
Console.WriteLine(e.ToString())
End Try
End Sub
End Class
This is one of numerous manners to program with sockets of cahting based applications
try this
Imports System
Imports System.Net.Sockets
Imports System.IO
Public Class ServerSocket1
Public Shared Sub Main()
Try
Dim status As Boolean = True
Dim servermessage As String = ""
Dim clientmessage As String = ""
Dim tcpListener As New TcpListener(8100)
tcpListener.Start()
Console.WriteLine("Server Started")
Dim socketForClient As Socket = tcpListener.AcceptSocket()
Console.WriteLine("Client Connected")
Dim networkStream As New NetworkStream(socketForClient)
Dim streamwriter As New StreamWriter(networkStream)
Dim streamreader As New StreamReader(networkStream)
While status
If socketForClient.Connected Then
servermessage = streamreader.ReadLine()
Console.WriteLine("Client:" + servermessage)
If (servermessage = "bye") Then
status = False
streamreader.Close()
networkStream.Close()
streamwriter.Close()
Return
End If
Console.Write("Server:")
clientmessage = Console.ReadLine()
streamwriter.WriteLine(clientmessage)
streamwriter.Flush()
End If
End While
streamreader.Close()
networkStream.Close()
streamwriter.Close()
socketForClient.Close()
Console.WriteLine("Exiting")
Catch e As Exception
Console.WriteLine(e.ToString())
End Try
End Sub
End Class
This is one of numerous manners to program with sockets of cahting based applications
First of all the link that JX gave was perfect. Harry you should put on some effort to understand how the code works.. Good explanation Jugortha..
Try this link too
Try this link too
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
One is as though nothing is a miracle.
The other is as if everything is.
•
•
Join Date: Feb 2008
Posts: 26
Reputation:
Solved Threads: 1
oh no , its not that I didnt think it was useful, I really aprichate the help, its just, well Im not the brightest of blubs
It just takes me a little time to understand and work things out, and after taking a good look at it, I have found out how it works, but considering I am only 15, I may not be as experianced as other profesional programmers here, but yes this is very helpful and I thank you.
With VB.NET I am starting to understand more all the time, although, there are a few things that I am highly confuzed with, one of these is 'sockets'
At the moment I am looking in how to make use of sockets.
Thanks anyway x
It just takes me a little time to understand and work things out, and after taking a good look at it, I have found out how it works, but considering I am only 15, I may not be as experianced as other profesional programmers here, but yes this is very helpful and I thank you.
With VB.NET I am starting to understand more all the time, although, there are a few things that I am highly confuzed with, one of these is 'sockets'
At the moment I am looking in how to make use of sockets.
Thanks anyway x
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: New to vba and vb.net. Need your expert advice.
- Next Thread: how to read a binary file holding floating-point values
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array basic binary bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images insert intel internet listview login mobile monitor ms navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port print problem problemwithinstallation project reports" save savedialog searchbox searchvb.net select serial soap sql string table tcp text textbox timer toolbox trim update updown user usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf








