/// <summary> /// 测试线程 /// </summary> public TestThread() { _testOption = new TestOption(); _timeOut = Config.LocalSetting.TestTimeOut; if (Config.LocalSetting.DefaultTestOption != null) { _testOption = Config.LocalSetting.DefaultTestOption; } _testProxyHelper = new TestProxyHelper(_testOption, _timeOut, Config.LocalSetting.UserAgent); _czIpHelper = new CzIpHelper(Config.LocalSetting.CzIpDbFileName); _thread = new Thread(DoWork); Name = _thread.ManagedThreadId.ToString(CultureInfo.InvariantCulture); Status = _thread.ThreadState.ToString(); }
public static string SearchIp(string strIp, string path) { var pz = new CzIpHelper(path); if (pz.SetDbFilePath(path)) { if (pz.IpAddressCheck(strIp)) { return(pz.GetAddressWithIp(strIp).ToLower().Replace("cz88.net", "Loamen.Com")); } else { return(strIp + "格式不正确"); } } else { return("文件" + path + "不存在"); } }