Example #1
0
        public string GetCookie()
        {
            try
            {
                return(CookieTools.GetCookieInternal(extandedWebBrowser1.Url, false));
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            return("");
        }
Example #2
0
        private void GoPage()
        {
            if (!string.IsNullOrEmpty(cookieTextBox.Text))
            {
                foreach (string c in cookieTextBox.Text.Split(';'))
                {
                    c.Trim();
                    string[] item = c.Split('=');
                    if (item.Length == 2)
                    {
                        CookieTools.InternetSetCookie(urlTextBox.Text, item[0], item[1]);
                    }
                }
            }

            Navigate(urlTextBox.Text);
        }
Example #3
0
        private void btn_ok_Click(object sender, EventArgs e)
        {
            bool bRet = false;

            if (!string.IsNullOrEmpty(cookieTb.Text) && !string.IsNullOrEmpty(urlTb.Text))
            {
                foreach (string c in cookieTb.Text.Split(';'))
                {
                    c.Trim();
                    string[] item = c.Split('=');
                    if (item.Length == 2)
                    {
                        bRet = CookieTools.InternetSetCookie(urlTb.Text, item[0], item[1]);

                        if (!bRet)
                        {
                            break;
                        }
                    }
                }
            }

            MessageBox.Show(bRet ? "设置成功!" : "设置失败!");
        }