473,379 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

irc chat.....

How do i parse the first nick before exclamation only. i am working
on irc chat similar to PIRCH or MIRC. I can only do this in vb6
here is debug.writeline:

Pi********@96.Red-213-97-140.pooles.rima-tde.net PRIVMSG #india :any1
seen a-kash?

eL*************@81.213.252.106 JOIN #india

Dim str As String = "Pi********@96.Red-213-97-140.pooles.rima-tde.net
PRIVMSG #india :any1 seen a-kash?"
Dim intI As Integer = str.IndexOf("!")
str = str.Substring(intI - 6)
TextBox1.AppendText(str)

i can't get nick name. i need first nick Picota , etc.

Nov 22 '05 #1
2 1403
Supra wrote:
How do i parse the first nick before exclamation only. i am working
on irc chat similar to PIRCH or MIRC. I can only do this in vb6
here is debug.writeline:
What do you mean by that? That you know how to do it in VB6 but not in
VB.Net or that you're looking for a VB6 answer? In the latter case,
you're in the wrong group.

For VB6 I suggest you check out the Mid function.

For .Net there are a couple of ways of doing this, the most clean one
would be to use regular expressions :
Regex("([\\w\\-\\[\\]\\`_\\^\\{\\|\\}]+![\\~\\w]+@[\\w\\.\\-]+)",
RegexOptions.Compiled | RegexOptions.Singleline);

But considering the 'slowness' of regex in the framework atm and the
amount of privmsg you will receive on busy channels, i think you're
better of using simple string manipulations like you did.

Pi********@96.Red-213-97-140.pooles.rima-tde.net PRIVMSG #india :any1
seen a-kash?

eL*************@81.213.252.106 JOIN #india

Dim str As String = "Pi********@96.Red-213-97-140.pooles.rima-tde.net
PRIVMSG #india :any1 seen a-kash?"
Dim intI As Integer = str.IndexOf("!")
Next I would check if you have a result, things like PRIVMSG in irc can
be send from a server directly (though highly unlikely). If they are
send from a server there will be no "!" in them. So you will have no
real nick. So you should check that intI > -1
str = str.Substring(intI - 6)
Here you would need to use the overloaded version of the Substring
functionality

Dim nick As String = str.Substring(0, intI)
TextBox1.AppendText(str)

i can't get nick name. i need first nick Picota , etc.


Yves
Nov 22 '05 #2
did u read rfc 1459.
the server sent 5 agruements: nick, nick's ip, PRIVMSG, channel, message..
u r simply wrong. the server must sent "!" to channel or Private channel
or dcc..
i am not thinking about vb6. I am thinking real vb.net not using mid,
left or right.
btw, i haven't tried regual expression. i am reading book "The
programming visual basic.net
by francesco balena" but i'm only into chapter 2
regards chapter 2.
regards

Yves Dhondt wrote:
Supra wrote:
How do i parse the first nick before exclamation only. i am
working on irc chat similar to PIRCH or MIRC. I can only do this in vb6
here is debug.writeline:

What do you mean by that? That you know how to do it in VB6 but not in
VB.Net or that you're looking for a VB6 answer? In the latter case,
you're in the wrong group.

For VB6 I suggest you check out the Mid function.

For .Net there are a couple of ways of doing this, the most clean one
would be to use regular expressions :
Regex("([\\w\\-\\[\\]\\`_\\^\\{\\|\\}]+![\\~\\w]+@[\\w\\.\\-]+)",
RegexOptions.Compiled | RegexOptions.Singleline);

But considering the 'slowness' of regex in the framework atm and the
amount of privmsg you will receive on busy channels, i think you're
better of using simple string manipulations like you did.

Pi********@96.Red-213-97-140.pooles.rima-tde.net PRIVMSG #india :any1
seen a-kash?

eL*************@81.213.252.106 JOIN #india

Dim str As String = "Pi********@96.Red-213-97-140.pooles.rima-tde.net
PRIVMSG #india :any1 seen a-kash?"
Dim intI As Integer = str.IndexOf("!")

Next I would check if you have a result, things like PRIVMSG in irc
can be send from a server directly (though highly unlikely). If they
are send from a server there will be no "!" in them. So you will have
no real nick. So you should check that intI > -1
str = str.Substring(intI - 6)

Here you would need to use the overloaded version of the Substring
functionality

Dim nick As String = str.Substring(0, intI)
TextBox1.AppendText(str)

i can't get nick name. i need first nick Picota , etc.


Yves


Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Savas Ates | last post by:
how can i do a chat page with asp .. does anyone have example codes or url.. or with java.. please help me...
0
by: Zeppo | last post by:
If you have no big plans and/or are up late tonite, you can chat/flame with the guys at RAC (www.rac4sql.net). We will begin sometime between 9:00-9:30 PM pst/ 12:00-12:30 AM est. We're using...
3
by: John Wright | last post by:
I am trying to create a very simple chat program using UDP through a web page. I am having problems getting this going. All the examples I've seen deal with remoting or application variables, or...
3
by: A | last post by:
Hi all! I am currently working on a project where I need to create a web-based chat application that will be used for auctions. If possible, could I get some advice on how to create chat...
5
by: Bhaiyyah | last post by:
I am repetitively failing to login with any user name for XHTML Chat. Here is some info I copied from view source: Link: http://www.shiachat.com/forum/chat.html ...
0
The1corrupted
by: The1corrupted | last post by:
Alright, I've set up a chat system that only works half way... I need suggestions on how to make it work better... I'm trying to figure out a way to make $_SESSION viewable to all players by...
1
oll3i
by: oll3i | last post by:
how do i run this example ? with openjms package com.ociweb.jms; import java.io.*; import javax.jms.*; import javax.naming.*;
1
oll3i
by: oll3i | last post by:
when i run it from bat (@start "CHAT to topic" run Chat)without durable subscriber the window for chat opens but when i added the durable subscriber to the code it stopped opening? import...
4
by: Gandalf | last post by:
I wrote a chat width AJAX. In my home wampserver apache it works just fine. The problem starts when I trying to upload the chat in to my real server. The chat prints error 403 in places which it...
3
by: John Dalberg | last post by:
I am looking for an asp.net based chat software. I have looked at some (asp.net and php based) and they consist usually of a javascript piece where the web user (visitor) initiates a chat from a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.