Exemplo n.º 1
0
        /// <summary>
        ///  获取某站点关键字在某搜索引擎的排名
        /// </summary>
        /// <param name="_engine"></param>
        /// <param name="Url"></param>
        /// <param name="KeyWord"></param>
        /// <returns></returns>
        public static string engineKeyWordinfo(EnumSearchEngine _engine, string Url, string KeyWord)
        {
            string re        = "200+";
            string Html      = "";
            string searchUrl = "";

            switch (_engine)
            {
            case EnumSearchEngine.Baidu:
                EchoHelper.Echo("关键词【" + KeyWord + "】的排名查询中,请稍后...", "", EchoHelper.EchoType.普通信息);
                searchUrl = "http://i.linkhelper.cn/searchkeywords.asp";
                string           postData = StringHelper.urlencode("url=" + Url + "&querywords=" + KeyWord + "&btnsubmit=%B2%E9+%D1%AF", "gb2312");
                CookieCollection cookies  = new CookieCollection();
                Html = new xkHttp().httpPost(searchUrl, postData, ref cookies, searchUrl, Encoding.GetEncoding("gb2312"));
                re   = RegexHelper.getMatch(Html, "百度排名:(.*?)&nbsp;&nbsp;", 1);
                if (re.Contains("排名在"))
                {
                    re = "200+";
                }
                break;

            case EnumSearchEngine.Google:
                break;
            }
            return(re);
        }
Exemplo n.º 2
0
        public static Socket GetSocket()
        {
            //设定服务端IP地址
            //IPAddress ip = IPAddress.Parse("223.4.173.93");
            //IPAddress ip = IPAddress.Parse("192.168.1.103");
            IPAddress ip           = IPAddress.Parse("116.255.139.227");
            int       port         = 9778;
            Socket    clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            try {
                clientSocket.Connect(new IPEndPoint(ip, port)); //配置服务端IP与端口
                //EchoHelper.Echo("连接服务端成功!", "系统登录", EchoHelper.EchoType.任务信息);
            } catch {
                EchoHelper.Echo("连接服务端失败,请联系Qin,检查服务端是否在开启!", "系统登录", EchoHelper.EchoType.错误信息);
                Thread.Sleep(5000);
                Environment.Exit(0);
                return(null);
            }
            return(clientSocket);
        }
Exemplo n.º 3
0
 public static void EchoPickEnd()
 {
     EchoHelper.Echo("========================================= end =========================================", "【分隔符】", EchoHelper.EchoType.普通信息);
 }
Exemplo n.º 4
0
 public static void EchoPickStart()
 {
     EchoHelper.Echo("=========================================start=========================================", "【分隔符】", EchoHelper.EchoType.普通信息);
 }
Exemplo n.º 5
0
 public static void EchoPickEnd(string info)
 {
     EchoHelper.Echo("┗━━━━━" + info + "━━━━━┛", "【分隔符】", EchoHelper.EchoType.普通信息);
 }
Exemplo n.º 6
0
 public static void EchoPickStart(string info)
 {
     EchoHelper.Echo("┏━━━━━" + info + "━━━━━┓", "【分隔符】", EchoHelper.EchoType.普通信息);
 }