Beispiel #1
0
 public Program()
 {
     wc = new MyWebClient();
 }
Beispiel #2
0
 public Program()
 {
     wc = new MyWebClient();
 }
Beispiel #3
0
        private MyWebClient PostHttp(MyWebClient wc, string baseUrl, string paramConcat)
        {
            wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            response = wc.UploadString(baseUrl, paramConcat);
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine(Environment.NewLine + "Scaricata prima pagina: {0}", BaseURI);

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("ResponseHeaders:" + Environment.NewLine + "{0}", wc.ResponseHeaders);
            var cc = wc._mContainer.GetCookies(new Uri("http://www.fastweb.it"));
            foreach (var cookie in cc)
            {
                Console.ForegroundColor = ConsoleColor.Magenta;
                Console.WriteLine("Cookie: {0}", cookie);
            }
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Redirect Location: {0}", wc._responseUri);

            foreach (var param in wc.responseParams)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("Fragment: {0} = {1}", param.Key, param.Value);
            }
            return wc;
        }