Updated 05.09.2007: Minor changes to work with the new MSN protocol
My wife showed me a website the other day where you could type in your email address and password for MSN Windows Live! Messenger, and it would show you which of your contacts didn’t have you in their contact lists, either because they’d never added you, or because they’d deleted you at some point. It’s a cool idea and a good way to prune some of the contacts that you never speak to from your contact list. But I don’t really wanna give up my user / pass to some third-party site, even though they promise not to log it anywhere, and most of these sites (at least the ones I saw) tried to make some money by sending advertisements to your contacts while they were checking them, which I definitely didn’t want. So, since I already have a project that uses the MSN protocol I figured I could probably whip something up myself.
(For those that have no interest in the programming and just want to have the program, you can download it here, those interested in the implementation can keep reading). To connect to MSN I use the excellent MSNPSharp library. That takes care of all the hard stuff so all I have to do is connect, loop through the contacts and print out those that are in your contact list but don’t have you in theirs. Now, I wrote this program in about 20 minutes, so it’s not the most beautiful code in the world, and the error-handling is almost non-existant, but it works (for me at least
), I found 4 contacts that didn’t have me in their list and promptly deleted them. Here it is:
using System;
using System.Threading;
using MSNPSharp;
// Author: Einar Egilsson
// http://tech.einaregilsson.com/2007/08/09/who-has-deleted-you-from-msn/
class MsnContactChecker
{
readonly Messenger msn = new Messenger();
const string Url =
"http://tech.einaregilsson.com/2007/08/09/who-has-deleted-you-from-msn/";
static void Main()
{
new MsnContactChecker().Check();
}
public void Check()
{
Console.WriteLine("\nMsnContactChecker v1.0\n{0}", Url);
try
{
Console.Write("\nUsername: ");
msn.Credentials.Account = Console.ReadLine().Trim();
Console.Write("Password: ");
msn.Credentials.Password = Console.ReadLine().Trim();
msn.NameserverProcessor.ConnectingException += Error;
msn.Nameserver.ExceptionOccurred += Error;
msn.Nameserver.AuthenticationError += Error;
msn.Nameserver.ServerErrorReceived += MsnError;
msn.ContactService.SynchronizationCompleted += Synchronized;
Console.WriteLine("\nConnecting to MSN...(this might take a little while)");
msn.Connect();
Thread.Sleep(Timeout.Infinite);
}
catch (Exception ex)
{
Error(this, new ExceptionEventArgs(ex));
}
}
void Synchronized(object sender, EventArgs e)
{
Console.WriteLine("\nContacts that have deleted you:");
int count = 0;
foreach (Contact c in msn.ContactList.Forward)
{
if (!c.OnReverseList)
{
count++;
if (c.Mail == c.Name)
{
Console.WriteLine(" {0}", c.Name);
}
else
{
Console.WriteLine(" {0} ({1})", c.Name, c.Mail);
}
}
}
if (count == 0)
{
Console.WriteLine(" None of your contacts have deleted you");
}
Exit(0);
}
private void MsnError(object sender, MSNErrorEventArgs e)
{
Console.WriteLine("\nError: {0}", e.MSNError);
Exit(1);
}
void Error(object sender, ExceptionEventArgs e)
{
Console.WriteLine("\nError: {0}", e.Exception.Message);
Exit(1);
}
private void Exit(int code)
{
Console.WriteLine("\nPress any key to quit program");
Console.Read();
Environment.Exit(code);
}
}
You can download the source and play with it. The zip file includes the MsnContactChecker.cs file and the library, MSNPSharp.dll.
Or to just get the compiled program you can download it here. It’s just a single executable file, since I used the excellent ILMerge tool from Microsoft to merge my .exe file and the DotMSN library into one file. Enjoy
thanx…works like a charm!!
Who blocked me on msn?
kak to? ja to niš ne kužim…..
how to use it and it can not download
hmmm, it’s very interesting .exe piece of telling you who has deleted on msn. it works fantastic. thanks a lot man. (I would like to receive an e-mail fro you that answer to this question: can you create a .exe file to see also who has blocked you on msn..? thx.)
adsadad
how can i get a list of who blocked me on MSN. ?
Sorry, there is no way to see who has blocked you on MSN, only who has deleted you.
Hi! Thanks for your tool, but it’s not flawless. (and that’s due MSN, not your programming) People I’ve added and have me in their list are mentioned as “not in list”. So be aware to make to quick conclusions.