|
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using DotNet.Utilities;
- using System.Text;
- namespace WebApplication2
- {
- public partial class _Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- public static string URLDecode(string text)
- {
- return HttpUtility.UrlDecode(text, Encoding.Default);
- }
- public static string URLEncode(string text)
- {
- return HttpUtility.UrlEncode(text, Encoding.Default);
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- HttpItem item = new HttpItem()
- {
- URL = "https://reg.163.com/logins.jsp?url=&product=urs&savelogin=&outfoxer=&domains=" +
- "&syscheckcode=bf304d663b8437558a9c075beb2f2375afe88a57&username="
- + URLEncode("abc@163.com") + "&password="
- + URLEncode("abc") + "&Submit=",
- Referer = "https://reg.163.com/logins.jsp"
- };
- HttpHelper http = new HttpHelper();
- string html = http.GetHtml(item);
- string cookie = item.Cookie;
- //TextBox1.Text = "cookie:" + cookie + "\r\n\r\n";
- //使用Cookie转到主页
- item.URL = "http://reg.163.com/Main.jsp";
- TextBox1.Text += http.GetHtml(item);
- }
- protected void TextBox1_TextChanged(object sender, EventArgs e)
- {
- }
- }
- }
复制代码 |
|