Esempio n. 1
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);
        }
Esempio n. 2
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 ? "设置成功!" : "设置失败!");
        }