コード例 #1
0
 public CookiesForm(string host)
 {
     InitializeComponent();
     textBoxX1.Text = host;
     try
     {
         advTree1.Nodes.Clear();
         if (CookieManager.CountCookiesFromHost(textBoxX1.Text) > 0)
         {
             IEnumerator <Cookie> l = CookieManager.GetCookiesFromHost(textBoxX1.Text);
             while (l.MoveNext())
             {
                 Cookie c  = l.Current;
                 Node   nd = new Node();
                 nd.Name = c.Name;
                 nd.Text = c.Name;
                 nd.Tag  = c;
                 Node ndc = new Node();
                 ndc.Name = c.Name + "c";
                 ndc.Text = c.Value;
                 nd.Nodes.Add(ndc);
                 advTree1.Nodes.Add(nd);
             }
         }
     }
     catch
     {
     }
 }
コード例 #2
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     try
     {
         advTree1.Nodes.Clear();
         if (CookieManager.CountCookiesFromHost(textBoxX1.Text) > 0)
         {
             IEnumerator <Cookie> l = CookieManager.GetCookiesFromHost(textBoxX1.Text);
             while (l.MoveNext())
             {
                 Cookie c  = l.Current;
                 Node   nd = new Node();
                 nd.Name = c.Name;
                 nd.Text = c.Name;
                 nd.Tag  = c;
                 Node ndc = new Node();
                 ndc.Name = c.Name + "c";
                 ndc.Text = c.Value;
                 nd.Nodes.Add(ndc);
                 advTree1.Nodes.Add(nd);
             }
         }
     }
     catch
     {
     }
 }
コード例 #3
0
 public void CountCookiesFromHost_ReutnrsNumberOfCookiesOnHost()
 {
     CookieManager.Add("myhost", "b", "c", "d", true, true, true, long.MaxValue);
     Assert.AreEqual(1, CookieManager.CountCookiesFromHost("myhost"));
 }