Instant Messenger Status Indicator - AIM, Yahoo, ICQ, MSN, Skype

No.of Views1923
Bookmarked2 times
Downloads 
Votes0
By  ansari.najmul@gmail.com   On  16 Feb 2010 03:02:27
Tag : ASP.NET , How to
Instant Messenger Status Indicator - AIM, Yahoo, ICQ, MSN, Skype
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

IM status indicator is as an easy and reliable way to check online status of a certain instant messenger account like Yahoo, AOL, MSN, Skype and ICQ. You can create your own IM status indicator to know who is online without logging into the specific messager.

This indicator ask for the protocol (Name of the messenge) and screen name (Messenger Id) and returns an image url that tells whether the user is online or offline.

The picture below show how it looks like.

Using the Code


It is very simple to create and use IM status indicator. Following are the steps to create IM status indicator.

* Step 1. Open Microsoft Visual Studio. Create a web site and named it IMStatusIndicator.
* Step 2.Create an .aspx file and named it IMStatusChech.aspx.
* Step 3. Design the form that looks like this. 

Image Loading

 

Step 4. And write the code below 

// Now double click on btnGetStatus button and write
// the code below

protected void btnGetStatus_Click(object sender, EventArgs e)
{
string Status = "";

if (txtScreenName.Text.Trim() != string.Empty)
{
Status = GetIMStatus();
}

lblStatus.Text = Status;
}

private string GetIMStatus()
{
if (rdbYahoo.Checked)
{
return GetIMStatus("yahoo", txtScreenName.Text);
}
else if (rdbMsn.Checked)
{
return GetIMStatus("msn", txtScreenName.Text);
}
else if (rdbAol.Checked)
{
return GetIMStatus("aol", txtScreenName.Text);
}
else if (rdbICQ.Checked)
{
return GetIMStatus("icq", txtScreenName.Text);
}
else if (rdbSkype.Checked)
{
return GetIMStatus("skype", txtScreenName.Text);
}
else return "";
}

// GetIMStatus is an overloaded method that asks for protocot, name of the messenger and
// messenger id and returns the online/offline image that tells the status.

private string GetIMStatus(string Protocol, string ScreenName)
{
string Status = "";
switch (Protocol)
{
case "yahoo":
Status = "";
break;

case "msn":
Status = " ScreenName +"/onurl=www.braintechnosys.com/images/" +
"msnonline.png/offurl=www.braintechnosys.com/images/msnoffline.png/" +
"unknownurl=www.braintechnosys.com/images/msnoffline.png\"
align=\"absmiddle\">";

break;

case "aol":
Status = " ScreenName +"?on_url=http://www.aim.com/remote/gr/" +
"MNB_online.gif&off_url=http://www.aim.com/remote/gr/MNB_offline.gif\"
style=\"border: none;\" alt=\"My status\" />";
break;

case "icq":
Status = "";
break;

case "skype":
Status = " ScreenName + "border=\"1\" />";
break;
}
return Status;
}

Now run the project and select one of the protocol,Messanger and enter messenger id, click on the button and get the status as result.

Output

Image Loading
 

Sample Project Source 

Download source files -3 kb

 
Sign Up to vote for this article
 
About Author
 
ansari.najmul@gmail.com
Occupation-Software Engineer
Company-NetEdge Computing Solutions
Member Type-Fresh
Location-India
Joined date-12 Aug 2009
Home Page-dotnetlogix.com
Blog Page-
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top