How do i create a chat application?

Using only VB language and doing it by visual studio

Page 1 of 1

1 Replies - 2954 Views - Last Post: 22 June 2009 - 06:30 AM Rate Topic: -----

#1 sya   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-June 09

How do i create a chat application?

Post icon  Posted 22 June 2009 - 05:21 AM

Ive been trying to search for codes that are plainly using VB to create a chat application using Visual Studio



   Private Sub GetMessages()  1
		 Dim db As LinqChatDataContext = New LinqChatDataContext()  
   
		 Dim messages = (From m In db.Messages _  
						 Where m.RoomID = Convert.ToInt32(lblRoomId.Text) _  
						 Order By m.TimeStamp Descending _  
						Select m).Take(20).OrderBy(Function(m As Message) m.TimeStamp)  
   
  
   
		 If Not messages Is Nothing Then  
			 Dim sb As StringBuilder = New StringBuilder()  
			 Dim ctr As Integer = 0	' toggle counter for alternating color  
   
			 For Each message In messages  
				 ' alternate background color on messages  
				 If ctr = 0 Then					   sb.Append("<div style='padding: 10px;'>")  
					 ctr = 1  
				 Else  
					 sb.Append("<div style='background-color: #EFEFEF; padding: 10px;'>")  
					 ctr = 0  
				 End If  
   
				 If message.User.Sex.ToString().ToLower() = "m" Then  
					 sb.Append("<img src='Images/manIcon.gif' style='vertical-align:middle' alt=''>  " + message.Text + "</div>")  
				 Else  
					 sb.Append("<img src='Images/womanIcon.gif' style='vertical-align:middle' alt=''>  " + message.Text + "</div>")  
				 End If  
			 Next  

   
			 litMessages.Text = sb.ToString()  
		 End If  
	 End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: How do i create a chat application?

#2 joezim007   User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 110
  • Joined: 13-September 08

Re: How do i create a chat application?

Posted 22 June 2009 - 06:30 AM

I personally can't see how anyone could post a solution to a chat application in a thread. I'm sure that someone could post some starter points to help you figure out the connections or the display or something, but asking for someone to help with an entire chat app is a bit absurd.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1