<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视频全免费网站色| 免费黄网在线观看| 亚洲精品无码成人片久久不卡| 好爽…又高潮了毛片免费看 | sss日本免费完整版在线观看| 亚洲男人的天堂在线va拉文| 一级毛片免费一级直接观看| 中文字幕亚洲专区| 国内精品一级毛片免费看| 久久久久亚洲av无码专区导航| 2019中文字幕在线电影免费 | 美女内射毛片在线看免费人动物| 亚洲综合激情另类小说区| 免费观看国产网址你懂的| 亚洲日韩精品国产一区二区三区| 白白国产永久免费视频| 一级毛片免费全部播放| 久久综合九九亚洲一区| 永久免费的网站在线观看| 污污视频免费观看网站| 亚洲日韩aⅴ在线视频| 亚洲一区免费在线观看| 亚洲AV成人片无码网站| 中文字幕人成人乱码亚洲电影 | 亚洲黄色在线电影| 永久免费AV无码网站在线观看| 一区二区在线视频免费观看| 亚洲AV无码成人网站久久精品大| 日韩版码免费福利视频| 美女免费精品高清毛片在线视| 国产成人无码综合亚洲日韩| 岛国av无码免费无禁网站| 又粗又长又爽又长黄免费视频| 亚洲一区二区在线免费观看| 永久黄网站色视频免费直播| 免费无码又爽又刺激网站|