예제 #1
0
파일: Program.cs 프로젝트: unarix/uProx
        // 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);
            }
        }
예제 #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");
                    }
                }
            }
        }
예제 #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));
    }
예제 #4
0
 var request = new OutgoingRequestFrame(proxy, operation, idempotent, compress, context);
예제 #5
0
 new OperaDriverCreator(proxy, timeout),
예제 #6
0
 new WinAppDriverCreator(proxy, timeout),
예제 #7
0
 new InternetExplorerDriverCreator(proxy, timeout),
예제 #8
0
 new IosDriverCreator(proxy, timeout),
예제 #9
0
 new FireFoxDriverCreator(proxy, timeout),
예제 #10
0
 new HeadlessFirefoxDriverCreator(proxy, timeout),
예제 #11
0
 new HeadlessEdgeDriverCreator(proxy, timeout),
예제 #12
0
 new EdgeDriverCreator(proxy, timeout),
예제 #13
0
 new HeadlessChromeDriverCreator(proxy, timeout),
예제 #14
0
 new ChromeDriverCreator(proxy, timeout),
예제 #15
0
 new AndroidDriverCreator(proxy, timeout),