CookieContainer container = new CookieContainer();
WebBrowser webBrowser1 = LoadSync(new Uri("http://www.保密.net/#user/hello.asp?err=pass&url="));
string cookieStr = webBrowser1.Document.Cookie;
string[] cookstr = cookieStr.Split(';');
foreach (string str in cookstr)
{
string[] cookieNameValue = str.Split('=');
Cookie ck = new Cookie(cookieNameValue[0].Trim().ToString(), cookieNameValue[1].Trim().ToString());
ck.Domain = ".保密.net";//你要登录的网站
container.Add(ck);
}
Console.WriteLine(container.ToCookie());
string cookieSt = container.ToCookie();
Xici xc = new Xici();
var encodePassWord = xc.H2("chenli0513", 8, cookieSt);
Console.WriteLine(encodePassWord);
string postData = string.Format("goto=&logPath=&UserCode={0}&UserName=chenli003&Password=&Logon=%B5%C7%C2%BC", encodePassWord);
//goto=&logPath=&UserCode=E889306F26FD0C80AAA05552A64C3549&UserName=chenli003&Password=&Logon=%B5%C7%C2%BC
string source = "";
CookieContainer cc = LoginForum("http://www.保密.net/user/logon.asp", "http://www.保密.net/user/hello.asp?err=pass&url=", postData, ref source, container);
WebBrowser webBrowser1 = LoadSync(new Uri("http://www.保密.net/#user/hello.asp?err=pass&url="));
string cookieStr = webBrowser1.Document.Cookie;
string[] cookstr = cookieStr.Split(';');
foreach (string str in cookstr)
{
string[] cookieNameValue = str.Split('=');
Cookie ck = new Cookie(cookieNameValue[0].Trim().ToString(), cookieNameValue[1].Trim().ToString());
ck.Domain = ".保密.net";//你要登录的网站
container.Add(ck);
}
Console.WriteLine(container.ToCookie());
string cookieSt = container.ToCookie();
Xici xc = new Xici();
var encodePassWord = xc.H2("chenli0513", 8, cookieSt);
Console.WriteLine(encodePassWord);
string postData = string.Format("goto=&logPath=&UserCode={0}&UserName=chenli003&Password=&Logon=%B5%C7%C2%BC", encodePassWord);
//goto=&logPath=&UserCode=E889306F26FD0C80AAA05552A64C3549&UserName=chenli003&Password=&Logon=%B5%C7%C2%BC
string source = "";
CookieContainer cc = LoginForum("http://www.保密.net/user/logon.asp", "http://www.保密.net/user/hello.asp?err=pass&url=", postData, ref source, container);