???????д?????????
???????????? ???????[ 2013/7/1 14:08:05 ] ????????
??????????????????????????????д?????????????????????????????
????????????????????????????Ip????????????????????
[TestMethod]
public void IPLibraryTest()
{
string whole = "211.64.0-255.0-255";
IPRange ipRange = new IPRange(whole);
List<IPAddress> addresses = ipRange.GetAllIP() as List<IPAddress>;
DataTable table = new DataTable("Ip");
JavaScriptSerializer serializer = new JavaScriptSerializer();
string url = string.Empty?? json = string.Empty;
Parallel.ForEach(addresses?? (address) =>
{
url = string.Format("http://ip.taobao.com/service/getIpInfo.php?ip={0}"?? address.ToString());
json = string.Empty;
try
{
json = Convert.ToString(NetworkHelper.PostRequest(url));
}
catch (Exception)
{
}
Object obj2 = serializer.DeserializeObject(json);
if (string.IsNullOrWhiteSpace(json)||obj2 == null)
return;
Dictionary<String?? Object> dictionary = (Dictionary<String?? Object>)obj2;
foreach (KeyValuePair<string?? object> valuePair in dictionary)
{
if (valuePair.Value.GetType() == typeof (Dictionary<string?? object>))
{
Dictionary<String?? Object> subdictionary = valuePair.Value as Dictionary<String?? Object>;
lock (table)
{
if (table.Columns.Count == 0)
{
foreach (KeyValuePair<string?? object> pair in subdictionary)
{
table.Columns.Add(pair.Key?? typeof (string));
}
}
DataRow row = table.NewRow();
foreach (KeyValuePair<string?? object> pair in subdictionary)
{
row[pair.Key] = pair.Value;
}
table.Rows.Add(row);
}
}
}
});
string databaseFile = @"H:DevelopmentSourceTestDatabase64IpLibrary.accdb";
OleDbHelper accessHelper = new OleDbHelper(databaseFile);
accessHelper.AppendData(table);
}
?????????е???????????????????????
???????????????? Visual Studio + Resharper + Visual Source Safe???????????????????????????????
????Visual Studio?????MSTest????????NUnit???????????????????????????Reshaprer????????????????????????С????????????????????е?????????????????????????????????????????????????У????????顣
????????????о??????????????????????С?????????????????????????????????????????????????????????????????????в??????????????????????????Windows Forms???????????????????????????????μ????????????????????????MSTest????????????????????????????????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11