954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Visual Basic 2008, Chat ! Urgent help needed

Hey people!

I have been using VB2008 since it came out now, and have also used the 2005 version, but I was just wondering, if there is ANY way to create a Chat Application, or any way to create an IM service.
Please help me :)

Thanks
x

harryl5
Light Poster
26 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 

of course there is a way..

c++ prog
Light Poster
44 posts since Nov 2007
Reputation Points: 10
Solved Threads: 1
 

how?

harryl5
Light Poster
26 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

thx, but im not eally sure how to fully understand this :S
i wil giv it a go :)
any other ideas?
x

harryl5
Light Poster
26 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 

there are code for this....
sorry if it can't help you.

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

wel i am sure the code is very useful but I just don't know how to use it :S

harryl5
Light Poster
26 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 

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

Jugortha
Junior Poster
172 posts since Oct 2007
Reputation Points: 11
Solved Threads: 16
 

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

arjunsasidharan
Practically a Posting Shark
826 posts since Aug 2006
Reputation Points: 347
Solved Threads: 13
 

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

harryl5
Light Poster
26 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 

hmm... do some googling to find sockets friend...
you are very enthusiastic for this...

happy finding :)

PS : age not a obstruction (do your best)

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

in order to help you to make the first step
focus on those objects

Socket , TcpClient, TcpListener, NetworkStream
these are main tool to cook a good based chat application you can get help either from MSDN or from the web just focus on those objects at the begining

Jugortha
Junior Poster
172 posts since Oct 2007
Reputation Points: 11
Solved Threads: 16
 

yeah just stay clear of the VB6 stuff, vb6 winsock apps dont upgrade cleanly to .net

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

O kool thanks, yer i got confuzed with the whole winsock thing, but Im gona try nd see if I can make a chat app, thanks for all the help !

harryl5
Light Poster
26 posts since Feb 2008
Reputation Points: 10
Solved Threads: 1
 

You must try, and if you have difficulties just send a message

Jugortha
Junior Poster
172 posts since Oct 2007
Reputation Points: 11
Solved Threads: 16
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You