自动登录csdn的代码谁有啊,记得原来csdn有这段代吗,有没有人知道 ╭∩╮(︶_︶)╭∩╮) 我还想问为什么我F1不能打开自动打开MSDN呢! :) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public bool Login(string Name,string Password) { string header = rda.Logon("http://www.csdn.net/member/logon.asp",Name,Password); if(header != null) { aspsessionid = header; hasLogin = true; return true; } else { hasLogin = false; return false; } } public string Logon(string Url,string Name,string Password) { UTF8Encoding encoding = new UTF8Encoding(); WebClient myWebClient = new WebClient(); NameValueCollection myNameValueCollection = new NameValueCollection(); myNameValueCollection.Add("name", Encoding.Default.GetString(encoding.GetBytes(Name))); myNameValueCollection.Add("pass",Password); myNameValueCollection.Add("type","0"); string header = ""; byte[] responseArray = myWebClient.UploadValues(Url,"POST",myNameValueCollection); header = myWebClient.ResponseHeaders[4].ToString() + "\n"; string content = Encoding.Default.GetString(responseArray); if(content.Length > 0) return null; else return header; } 求助C# richtextbox c# 中的.exe文件 与 access 数据库 纠结!!!为什么会变成这样呢?? 合并两个表 Repeater嵌套Repeater中的取值问题。 小妹求教!DataTable里应用SQL语句! 各位,如何读一个目录下面的一个文件的ContentType,如word的"application/msword"? 在程序里设置datetimepicker时间 怎么控制Excel的字体,还有是否存在网格! 中国有多少贫困人口?城镇低保人数7年增10倍 连接数据库的问题! 在C#中的重载是不是只有在基类方法是virtual的情况下才行?
{
string header = rda.Logon("http://www.csdn.net/member/logon.asp",Name,Password);
if(header != null)
{
aspsessionid = header;
hasLogin = true;
return true;
}
else
{
hasLogin = false;
return false;
}
}
public string Logon(string Url,string Name,string Password)
{
UTF8Encoding encoding = new UTF8Encoding();
WebClient myWebClient = new WebClient();
NameValueCollection myNameValueCollection = new NameValueCollection();
myNameValueCollection.Add("name", Encoding.Default.GetString(encoding.GetBytes(Name)));
myNameValueCollection.Add("pass",Password);
myNameValueCollection.Add("type","0"); string header = ""; byte[] responseArray = myWebClient.UploadValues(Url,"POST",myNameValueCollection); header = myWebClient.ResponseHeaders[4].ToString() + "\n"; string content = Encoding.Default.GetString(responseArray); if(content.Length > 0)
return null;
else
return header;
}