public CheckUrl SpeedTest(string url) { var minTime = 0; var maxTime = 0; for (var i = 0; i < 3; i++) { int testValue = _request.GetUrlTime(url); if (testValue <= 0) { continue; } if (minTime == 0 || minTime > testValue) { minTime = testValue; } if (testValue > maxTime) { maxTime = testValue; } } var AddToList = new CheckUrl { Host = _host, Url = url, MinTime = minTime, MaxTime = maxTime }; return(AddToList); }
/* * Testing speed. */ public CheckUrl steedTest(string url) //We will make 3 test to get Min and Max value { int MinVal = 0; int MaxVal = 0; for (int i = 0; i < 3; i++) { int TestValue = _request.GetUrlTime(url); if (TestValue > 0) { if (MinVal == 0 || MinVal > TestValue) { MinVal = TestValue; } if (TestValue > MaxVal) { MaxVal = TestValue; } } } CheckUrl AddToList = new CheckUrl(); AddToList.Host = _host; AddToList.Url = url; AddToList.MinTime = MinVal; AddToList.MaxTime = MaxVal; return(AddToList); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CheckUrl url = new CheckUrl(); url.CheckUrlUser(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CheckUrl url = new CheckUrl(); url.CheckUrlUser(); BindType(); SelectInfo(); pageBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CheckUrl url = new CheckUrl(); url.CheckUrlUser(); if (!string.IsNullOrEmpty(Request["Phone"])) { Phone = Encrypt.PageDispelParam(Request["Phone"]); } pageBind(); } }
private void GetUrlList() { string ContentXml = _request.GetUrl(_host); var UrlCollection = new Regex("<loc>(?<url>(.*?))</loc>").Matches(ContentXml); if (UrlCollection.Count != 0) { foreach (Match item in UrlCollection) { string itemStr = item.Groups["url"].Value; if (string.IsNullOrEmpty(itemStr)) { continue; } _requestTimeouts.Add(new CheckUrl { Url = itemStr, MinTime = 0, MaxTime = 0 }); } } else { var uriUrl = new Uri(_host); _host = new Uri(uriUrl, "/").ToString(); IEnumerable <string> urls = BuildSitemap(); foreach (string url in urls) { var AddToList = new CheckUrl { Url = url, MinTime = 0, MaxTime = 0 }; _requestTimeouts.Add(AddToList); } } }
private bool TestConnecting() { bool result = false; try { Aleph aleph = new Aleph(); aleph.UrlAleph = txtUrl.Text; aleph.Library = txtLibrary.Text; aleph.UpdateFlag = txtFlag.Text; result = new CheckUrl().CheckUrlExist(aleph.UrlAleph); } catch (Exception ex) { lbStatus.ForeColor = Color.Red; lbStatus.Text = "Connection failed"; MessageBox.Show("Lỗi: " + ex.Message, "Thông báo!"); } return(result); }
private void GetUrlList() { string ContentXml = _request.GetUrl(_host); /* * I can use XmlDocument but some sitemaps is different. */ MatchCollection UrlCollection = new Regex("<loc>(?<url>(.*?))</loc>").Matches(ContentXml); if (UrlCollection.Count != 0) //if sitemap.xml if not empty { foreach (Match item in UrlCollection) { string itemStr = item.Groups["url"].Value; if (itemStr != "") { CheckUrl AddToList = new CheckUrl(); AddToList.Url = itemStr; AddToList.MinTime = 0; AddToList.MaxTime = 0; _requestTimeots.Add(AddToList); // Add urls for test } } } else // if sitemap is empty we need build our list { Uri uriUrl = new Uri(_host); _host = new Uri(uriUrl, "/").ToString(); string[] urls = BuildSitemap(); foreach (string url in urls) { CheckUrl AddToList = new CheckUrl(); AddToList.Url = url; AddToList.MinTime = 0; AddToList.MaxTime = 0; _requestTimeots.Add(AddToList); // Add urls for test } } }
public ConsulHttpCheckSettings WithRoute(object routedTo, string urlPart) { CheckEndpoint = new CheckUrl(urlPart, routedTo); return(this); }