Guest User

post

a guest
Apr 22nd, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1.             // 呼び出し部分など
  2.             // ボタンのクリックイベントに記述しています
  3.         byte[] data = null;
  4.  
  5.             CookiePostClass cpclass = new CookiePostClass();
  6.             Encoding enc = Encoding.GetEncoding("euc-jp");
  7.  
  8.             cpclass.GetHtml("http://www.yahoo.co.jp/");
  9.  
  10.             cpclass.GetHtml("http://kids.yahoo.co.jp/");
  11.             string str = cpclass.GetHtml("http://kids.yahoo.co.jp/");
  12.  
  13.             string search = "<input type=\"hidden\" name=\"t\" value=\"";
  14.  
  15.             int start = str.IndexOf(search) + search.Length;
  16.             int length = str.IndexOf("\"", start) - start;
  17.  
  18.             string md5 = str.Substring(start, length);
  19.  
  20.             search = "<input type=\"hidden\" name=\"sk\" value=\"";
  21.  
  22.             start = str.IndexOf(search) + search.Length;
  23.             length = str.IndexOf("\"", start) - start;
  24.  
  25.             string md52 = str.Substring(start, length);
  26.            
  27.             string post = "poll_id=" + HttpUtility.UrlEncode("11989") + "&t=" + HttpUtility.UrlEncode(md5) + "&sk=" + HttpUtility.UrlEncode(md52) + "&user_choice=" + HttpUtility.UrlEncode("8");
  28.             MessageBox.Show(post);
  29.  
  30.             textBox5.Text = cpclass.PostData("http://kids.yahoo.co.jp/quizresults.php", post);
Advertisement
Add Comment
Please, Sign In to add comment