Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- using System.Windows.Forms;
- namespace NewBeanfunLogin
- {
- public partial class Form_Main : Form
- {
- Form_Log frmLog = null;
- public Form_Main()
- {
- InitializeComponent();
- frmLog = new Form_Log();
- }
- private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
- {
- }
- private void wb_Navigating(object sender, WebBrowserNavigatingEventArgs e)
- {
- string url = e.Url.ToString();
- Regex[] regAds = new Regex[] {
- new Regex(@"^https?://tw\.adnew\.beanfun\.com"),
- new Regex(@"^https?://tw\.beanfun\.com/bfweb/NEW/"),
- new Regex(@"^https?://tw\.new\.beanfun\.com/\d+_\d+\.html"),
- new Regex(@"^https?://tw\.new\.beanfun\.com/newHomePage/quicklink\.html"),
- new Regex(@"^about:"),
- // new Regex(@"^https?://tw\.beanfun\.com/BFWeb/ADwords\.aspx"),
- };
- foreach (Regex regAd in regAds)
- if (regAd.IsMatch(url)) { e.Cancel = true; return; }
- if (
- url.Contains("loader_iframe_custom.html") ||
- url.Contains("ADwords.aspx") ||
- url.Contains("loading.htm")
- ) return;
- if (url.StartsWith("res:") && url.Contains("beanfun:"))
- url = url.Substring(url.IndexOf("beanfun:"));
- Regex regLogin = new Regex(@"^https?://tw\.newlogin\.beanfun\.com/loginform\.aspx\?skey=(\w+)");
- if (regLogin.IsMatch(url))
- {
- string skey = regLogin.Match(url).Groups[1].Value;
- e.Cancel = true;
- wb.Navigate("https://tw.newlogin.beanfun.com/login/id-pass_form.aspx?skey=" + skey);
- frmLog.lstLog.Items.Add("skey: " + skey);
- return;
- }
- Regex regLogined = new Regex(@"^https?://tw\.new\.beanfun\.com/beanfun_block/bflogin/handle_writecookie\.aspx\?t=\w+&d=\w+");
- if (regLogined.IsMatch(url))
- {
- wb.Navigate("http://tw.new.beanfun.com/game_zone/");
- frmLog.lstLog.Items.Add("Logined...");
- return;
- }
- if (!url.StartsWith("javascript")) frmLog.lstLog.Items.Add("Navigating: " + url);
- }
- private void btnLogin_Click(object sender, EventArgs e)
- {
- if (wb.IsBusy) wb.Stop();
- wb.Navigate("https://tw.new.beanfun.com/beanfun_block/bflogin/default.aspx?service=999999_T0");
- }
- private void btnLog_Click(object sender, EventArgs e)
- {
- frmLog.Show();
- frmLog.Focus();
- }
- private void btnBotLogin_Click(object sender, EventArgs e)
- {
- new Form_Login().Show();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement