Read and Write cookies
/** // <Summary>
/// Write cookie
/// </Summary>
Private void writecookie ()
{
Httpcookie hcirmstockcode = new httpcookie ("irmstockcode ");
Httpcookie hcirmusername = new httpcookie ("irmusername ");
Httpcookie hcirmpassword = new httpcookie ("irmpassword ");
Hcirmstockcode. Domain = "szxeasyirm.qhtserver1.com ";
Hcirmusername. Domain = "szxeasyirm.qhtserver1.com ";
Hcirmpassword. Domain = "szxeasyirm.qhtserver1.com ";
Hcirmstockcode. value = "888888 ";
Hcirmusername. value = "hgjiradmin ";
Hcirmpassword. value = "000000 ";
Response. Cookies. Add (hcirmstockcode );
Response. Cookies. Add (hcirmusername );
Response. Cookies. Add (hcirmpassword );
}
/** // <Summary>
/// Read cookies and return cookies
/// </Summary>
Private string readcookie ()
{
Httpcookiecollection termcookies = request. Cookies;
String struserinfo = string. empty;
String strtmpstockcode = string. empty;
String strtmpusername = string. empty;
String strtmppassword = string. empty;
For (INT I = 0; I <termcookies. Count; I ++)
{
String strcookiename = termcookies [I]. Name;
If (strcookiename = "irmstockcode ")
{
Strtmpstockcode = termcookies [I]. value;
}
If (strcookiename = "irmusername ")
{
Strtmpusername = termcookies [I]. value;
}
If (strcookiename = "irmpassword ")
{
Strtmppassword = termcookies [I]. value;
}
}
Struserinfo = strtmpstockcode + "|" + strtmpusername + "|" + strtmppassword;
Return struserinfo;
}