Example #1
0
        // Ejemplo de como escribir una entidad a json
        private void writejson()
        {
            List <proxy> proxys = new List <proxy>();
            proxy        prox   = new proxy();

            prox.ip   = "10.10.10.10";
            prox.port = "10001";
            proxys.Add(prox);

            proxy prox2 = new proxy();

            prox2.ip   = "10.10.10.10";
            prox2.port = "10001";
            proxys.Add(prox);

            string output = Newtonsoft.Json.JsonConvert.SerializeObject(proxys);

            string filePath = "proxylist.json";

            using (System.IO.StreamWriter file =
                       new System.IO.StreamWriter(System.IO.File.Create(filePath)))
            {
                file.WriteLine(output);
            }
        }
Example #2
0
        //抓去处理方法
        static void getProxyList(object pageIndex)
        {
            string urlCombin = "http://www.xicidaili.com/wt/" + pageIndex.ToString();
            string catchHtml = catchProxIpMethord(urlCombin, "UTF8");


            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
            doc.LoadHtml(catchHtml);


            HtmlNode table = doc.DocumentNode.SelectSingleNode("//div[@id='wrapper']//div[@id='body']/table[1]");

            HtmlNodeCollection collectiontrs = table.SelectNodes("./tr");



            for (int i = 0; i < collectiontrs.Count; i++)
            {
                HtmlAgilityPack.HtmlNode itemtr = collectiontrs[i];


                HtmlNodeCollection collectiontds = itemtr.ChildNodes;
                //table中第一个是能用的代理标题,所以这里从第二行TR开始取值
                if (i > 0)
                {
                    HtmlNode itemtdip = (HtmlNode)collectiontds[3];

                    HtmlNode itemtdport = (HtmlNode)collectiontds[5];

                    HtmlNode itemtdspeed = (HtmlNode)collectiontds[13];

                    string ip   = itemtdip.InnerText.Trim();
                    string port = itemtdport.InnerText.Trim();


                    string speed      = itemtdspeed.InnerHtml;
                    int    beginIndex = speed.IndexOf(":", 0, speed.Length);
                    int    endIndex   = speed.IndexOf("%", 0, speed.Length);

                    int subSpeed = int.Parse(speed.Substring(beginIndex + 1, endIndex - beginIndex - 1));
                    //如果速度展示条的值大于90,表示这个代理速度快。
                    if (subSpeed > 90)
                    {
                        proxy temp = new proxy(ip, port, subSpeed);

                        masterPorxyList.Add(temp);
                        Console.WriteLine("当前是第:" + masterPorxyList.Count.ToString() + "个代理IP");
                    }
                }
            }
        }
Example #3
0
    public INativeHandleContract LoadAssembly(string assemblyname, string fullInterfaceName)
    {
        if (ad != null)
        {
            AppDomain.Unload(ad);
        }
        var domSetup = new AppDomainSetup();

        domSetup.ApplicationBase    = AppDomain.CurrentDomain.BaseDirectory;
        domSetup.PrivateBinPath     = AppDomain.CurrentDomain.BaseDirectory;
        domSetup.ConfigurationFile  = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
        domSetup.LoaderOptimization = LoaderOptimization.MultiDomainHost;
        var adevidence = AppDomain.CurrentDomain.Evidence;

        ad = AppDomain.CreateDomain(assemblyname, adevidence, domSetup);
        ad.AssemblyResolve += ad_AssemblyResolve;
        AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
        remoteWorker = (proxy)ad.CreateInstanceAndUnwrap(typeof(proxy).Assembly.FullName, "INATO.UPINAIS.UCLibrary.proxy");
        return(remoteWorker.GetControl(assemblyname, fullInterfaceName));
    }
Example #4
0
 var request = new OutgoingRequestFrame(proxy, operation, idempotent, compress, context);
Example #5
0
 new OperaDriverCreator(proxy, timeout),
Example #6
0
 new WinAppDriverCreator(proxy, timeout),
Example #7
0
 new InternetExplorerDriverCreator(proxy, timeout),
Example #8
0
 new IosDriverCreator(proxy, timeout),
Example #9
0
 new FireFoxDriverCreator(proxy, timeout),
Example #10
0
 new HeadlessFirefoxDriverCreator(proxy, timeout),
Example #11
0
 new HeadlessEdgeDriverCreator(proxy, timeout),
Example #12
0
 new EdgeDriverCreator(proxy, timeout),
Example #13
0
 new HeadlessChromeDriverCreator(proxy, timeout),
Example #14
0
 new ChromeDriverCreator(proxy, timeout),
Example #15
0
 new AndroidDriverCreator(proxy, timeout),