<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    namespace CheckDomain
    {

        using System.Net;
        using System.IO;
        using System.Text.RegularExpressions;
        using System.Collections;
        public delegate void CallBack(DataGridViewRow dgrv, DomainStatus ds);
        public delegate void CallBackEx(string dgrv, DomainStatus ds);
        public class ThreadWithData
        {
            public UrlCheck uc = new UrlCheck();
            public CallBack CBack;
            public CallBackEx CBackEx;
            public ArrayList DomainList;
            public DataGridViewRow[] DataGridViewRowDomainList;

            public ThreadWithData(ArrayList tempDomain, CallBack tempCBack)
            {
                this.CBack = tempCBack;
                this.DomainList = tempDomain;

            }
            public ThreadWithData(DataGridViewRow[] tempDataGridViewRowDomainList, CallBack tempCBack)
            {
                this.CBack = tempCBack;
                this.DataGridViewRowDomainList = tempDataGridViewRowDomainList;

            }
            public ThreadWithData(ArrayList tempDomain, CallBackEx tempCBack)
            {
                this.CBackEx = tempCBack;
                this.DomainList = tempDomain;

            }
            public void Run()
            {
                foreach (DataGridViewRow tempDomain in DomainList)
                {

                    DomainStatus tempDS = uc.GetDomainStatus(tempDomain.Cells["Column2"].Value.ToString());
                    CBack(tempDomain, tempDS);
                    //CBack(tempDS.Status);
                }
            }
            public void RunMy()
            {
                foreach (DataGridViewRow tempDomain in DomainList)
                {

                    DomainStatus tempDS = uc.GetDomainStatus(tempDomain.Cells["Column12"].Value.ToString());
                    CBack(tempDomain, tempDS);
                    //CBack(tempDS.Status);
                }
            }
            public void RunGrid()
            {
                foreach (DataGridViewRow tempDomain in DataGridViewRowDomainList)
                {

                    DomainStatus tempDS = uc.GetDomainStatus(tempDomain.Cells["Column2"].Value.ToString());
                    CBack(tempDomain, tempDS);
                }
            }
            public void RunEx()
            {
                foreach (string tempDomain in DomainList)
                {

                    DomainStatus tempDS = uc.GetDomainStatus(tempDomain);
                    CBackEx(tempDomain, tempDS);
                    //CBack(tempDS.Status);
                }
            }
        }
        public class DomainStatus
        {
            public bool Status;
            public DateTime Create_Date;
            public DateTime Updated_Date;
            public DateTime Expiration_Date;
        }
        public class UrlCheck
        {
            public string GetHttpData(string sUrl, string charset)
            {
                string sRslt = null;
                WebResponse oWebRps = null;
                WebRequest oWebRqst = WebRequest.Create(sUrl);
                oWebRqst.Timeout = 50000;
                try
                {
                    oWebRps = oWebRqst.GetResponse();
                }

                finally
                {
                    if (oWebRps != null)
                    {
                        StreamReader oStreamRd = new StreamReader(oWebRps.GetResponseStream(), System.Text.Encoding.GetEncoding(charset));
                        sRslt = oStreamRd.ReadToEnd();
                        oStreamRd.Close();
                        oWebRps.Close();
                    }
                }
                return sRslt;
            }
            //
            //Updated Date: 25-mar-2010
            //Creation Date: 23-apr-1996
            //Expiration Date: 24-apr-2019
            public DomainStatus GetDomainStatus(string domain)
            {
                DomainStatus tempDomainStatus = new DomainStatus();
                string tempContent = "";
                try
                {
                    tempContent= GetHttpData("            }
                catch (Exception ex)
                {
                    tempContent = "";
                   
                }
                string[] tempCdate = GetRegValue(tempContent, "Creation Date:(?<cdate>([^\\n]+))", "cdate", true);

                if (tempCdate.Length > 0)
                {
                    string[] tempUpdate = GetRegValue(tempContent, "Updated Date:(?<udate>([^\\n]+))", "udate", true);
                    string[] tempEdate = GetRegValue(tempContent, "Expiration Date:(?<edate>([^\\n]+))", "edate", true);
                    DateTime dt1 = DateTime.Parse(tempCdate[0]);
                    DateTime dt2 = DateTime.Parse(tempUpdate[0]);
                    DateTime dt3 = DateTime.Parse(tempEdate[0]);
                    tempDomainStatus.Status = true;
                    tempDomainStatus.Create_Date = dt1;
                    tempDomainStatus.Updated_Date = dt2;
                    tempDomainStatus.Expiration_Date = dt3;
                }
                else
                {
                    tempDomainStatus.Status = false;
                }
                return tempDomainStatus;

            }
            /// <summary>
            /// 正則表達式取值
            /// </summary>
            /// <param name="HtmlCode">源碼</param>
            /// <param name="RegexString">正則表達式</param>
            /// <param name="GroupKey">正則表達式分組關鍵字</param>
            /// <param name="RightToLeft">是否從右到左</param>
            /// <returns></returns>
            public string[] GetRegValue(string HtmlCode, string RegexString, string GroupKey, bool RightToLeft)
            {
                MatchCollection m;
                Regex r;
                if (RightToLeft == true)
                {
                    r = new Regex(RegexString, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.RightToLeft);
                }
                else
                {
                    r = new Regex(RegexString, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                }
                m = r.Matches(HtmlCode);
                string[] MatchValue = new string[m.Count];
                for (int i = 0; i < m.Count; i++)
                {
                    MatchValue[i] = m[i].Groups[GroupKey].Value;
                }
                return MatchValue;
            }
            public string[] GetRegValue1(string HtmlCode, string RegexString, string GroupKey, bool RightToLeft)
            {
                MatchCollection m;
                Regex r;
                if (RightToLeft == true)
                {
                    r = new Regex(RegexString, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.RightToLeft);
                }
                else
                {
                    r = new Regex(RegexString, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                }
                m = r.Matches(HtmlCode);
                string[] MatchValue = new string[m.Count];
                for (int i = 0; i < m.Count; i++)
                {
                    MatchValue[i] = m[i].Groups[GroupKey].Value;
                }
                return MatchValue;
            }

        }
    }


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    常用鏈接

    留言簿(5)

    隨筆分類

    隨筆檔案

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 久久久久久A亚洲欧洲AV冫| 最近最好的中文字幕2019免费| 国产又大又长又粗又硬的免费视频 | 男人的好看免费观看在线视频| 亚洲国产一区在线| 伊人久久免费视频| 亚洲第一页在线观看| 1000部拍拍拍18勿入免费视频软件 | 久久久久一级精品亚洲国产成人综合AV区| 精品久久久久久久久亚洲偷窥女厕| 最近2019中文免费字幕| 亚洲成AV人影片在线观看| 国产一级理论免费版| 国产乱妇高清无乱码免费| 亚洲AV永久无码区成人网站 | 又黄又爽一线毛片免费观看| 日亚毛片免费乱码不卡一区| 久久久久亚洲精品中文字幕| 亚洲国产精品免费视频| 亚洲一本之道高清乱码| 国产免费久久精品| 两性色午夜免费视频| 亚洲视频在线播放| 在线视频免费观看www动漫| 国产精品亚洲一区二区无码| 亚洲中文字幕成人在线| 久久精品国产这里是免费| 亚洲一级毛片在线播放| 国产一区二区三区免费看| 中文字幕高清免费不卡视频| 亚洲高清中文字幕综合网| 黄网址在线永久免费观看| 你是我的城池营垒免费观看完整版| 7777久久亚洲中文字幕蜜桃| 成年在线网站免费观看无广告| 青青视频免费在线| 337p日本欧洲亚洲大胆精品555588 | 国产成人精品123区免费视频| 精精国产www视频在线观看免费| 亚洲黄色一级毛片| 免费一级成人毛片|