When I opened Hotmail today, I accidentally read the script written by Microsoft. I found that many of the scripts behind Hotmail are also intentionally messed up, so that the readability is worse.
Many people use MSN. If you use Hotmail or a contact in MSN to send you a mail, Hotmail will automatically display its status. Including many Microsoft products, such as SPS and outlook.
I took a look.CodeSPS call ActiveX regardless of Hotmail or outlook. First, judge the login information of current MSN. The Code is as follows:
Msngrobj = New Activexobject ( " Msnmessenger. hotmailcontrol " );
State = (Msngrobj. getlocaluserstatus ();
// Different return values indicate different States
When determining the contact information, it is
Getuserstatus
Function Msngrgetcontact (EM, Loc)
{
VaR RET;
VaR IMG;
VaR MSG;
VaR CS = Msngrobj. getuserstatus (EM );
If (CS = Null ) Return ;
Switch (CS)
{
Case 1 :
IMG = 1
MSG = Rochelle isoffline
Break ;
Case 2 :
IMG = 0
MSG = L_isonline
Break ;
Case 10 :
IMG = 3
MSG = Rochelle isbusy
Break ;
Case 14 :
IMG = 2
MSG = L_isbrb
Break ;
Case 18 :
Case 34 :
IMG = 2
MSG = Rochelle isaway
Break ;
Case 50 :
IMG = 3
MSG = Rochelle isonthephone
Break ;
Case 66 :
IMG = 2
MSG = L_isouttolunch
Break ;
}
In fact, I did write a piece of code to achieve the same effect. In fact, it is not so easy to implement it unless I use the SDK authorized by Microsoft.
My simple code:
Msngrobj = new activexobject ("msnmessenger. hotmailcontrol ");
Alert (msngrobj. getlocaluserstatus ());
An error object error is returned during execution.
I have determined that msngrobj is successfully created, and the getlocaluserstatus error occurs.
Therefore, it is assumed that getlocaluserstatus needs to obtain some context or session information, which may be the cookie stored on the client in the web app.
Slightly modify the code
First, get the cookie after MSN Hotmail login, and then attach this cookie to my code, like the principle of CSS :)
Document. Cookie = "msnads = Um = ;";
Document. Cookie = "mspauth = 5znke3zkibklpwlhl8emwllcj1lpc16yodjsddu3ocxlv % 21u2fe9wk % 2aida2% 21 nnati % ..."
Msngrobj = new activexobject ("msnmessenger. hotmailcontrol ");
Alert (msngrobj. getlocaluserstatus ());
The result is the same.
In fact, this is expected. Do you know where the MSN client's login information is stored? Haha