예제 #1
0
        static void Main(string[] args)
        {
            WebBrowser web = new WebBrowser();
            //ResponsePack_WebBrowser r = web.Request("https://www.baidu.com", null) as ResponsePack_WebBrowser;
            string  json = File.ReadAllText(@"C:\Users\Guo\Desktop\zc-paimai.taobao.com.har");
            HttpHar h    = JsonConvert.DeserializeObject <HttpHar>(json);

            Cookie[] c = new Cookie[0];
            var      r = web.Request(h.log.entries[0].request, c);

            web.RefreshConfig();
            RequestConfig req = new RequestConfig();
            ChannelFactory <IRequestContract> channelFactory;

            using (channelFactory = new ChannelFactory <RequestContract.IRequestContract>("Request"))
            {
                IRequestContract ito = channelFactory.CreateChannel();
                while (true)
                {
                    // ResponsePack_WebBrowser res = ito.BrowserRequest(h.log.entries[0].request);
                    var    coo  = new List <Cookie>();
                    string html = ito.Get(h.log.entries[0].request.url, coo);


                    //Console.WriteLine(html);
                }
                // action?.Invoke(channelFactory.CreateChannel());
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            WebBrowser web = new WebBrowser();
            //ResponsePack_WebBrowser r = web.Request("https://www.baidu.com", null) as ResponsePack_WebBrowser;
            string json = File.ReadAllText(@"C:\Users\Sier\Desktop\m.ctrip.com.har");
            //string json = File.ReadAllText(@"C:\Users\Sier\Desktop\aio.liantuo.com.har");
            HttpHar h = JsonConvert.DeserializeObject <HttpHar>(json);

            Cookie[] c = new  Cookie[0];
            h.log.entries[0].request.url = "https://123.sogou.com/";
            var r = web.Request(h.log.entries[0].request, c);

            web.RefreshConfig();
            RequestConfig req = new RequestConfig();
        }
예제 #3
0
        static void Main(string[] args)
        {
            string json = File.ReadAllText(@"C:\Users\Sier\Desktop\m.ctrip.com.har");
            //string json = File.ReadAllText(@"C:\Users\Sier\Desktop\aio.liantuo.com.har");
            HttpHar h = JsonConvert.DeserializeObject <HttpHar>(json);

            HttpServer s = new HttpServer();
            var        r = s.GetHttpResult(h.log.entries[0].request);

            s          = new HttpServer();
            s.Host     = "";
            s.Url      = "";
            s.Method   = "";
            s.PostData = "";
            r          = s.GetHttpResult();
        }