??????????????????????????????д?????????????????????????????

????????????????????????????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????????????????????????????????????????????????????????????????????????????????