using system;
2using system.collections.generic;
3using system.text;
4using system.net;
56namespace iputility723
2425 }
2627 public class iprange
28
41 set
42 }
4344 /**//**//**
45 /// 開始ip
46 ///
47 public ulong beginip
48
50 set
51 }
5253 /**//**//**
54 /// 結束ip
55 ///
56 public ulong endip
57
59 set
60 }
6162
63 /**//**//**
64 /// 此ip段的範圍
65 ///
66 public ulong range
67
72 }
7374 public iprange(string name, string ipbegin, string ipend)
75
8081
82 public static ulong ip2a(string ip)
83
9293 return ret;
9495 }
9697
98 public static int compare(iprange x, iprange y)
99
106107 }
108109 public class iprangemanage
110
113114 private list< iprange> _iprangelist = new list< iprange>();
115 private bool _needsort = true;
116117 public void add(iprange iprange)
118
122123 private void sort()
124
129 }
130131 public iprange search(string ipstring)
132
143 }
144 return null;
145 }
146 }
147}
148
查詢IP所在區段 C
程式語言 c 類 別 網路應用,實用演算法 主要功能 查詢乙個ip所有的ip段.關鍵 從byte陣列到ulong的轉換出來的數字和 ipaddress.address 返回值的是不一樣的.using system using system.collections.generic using syst...
vi區段刪除
區段刪除是編輯和分析一些冗長的配置檔案或日誌檔案時比較常用的操作。簡記下vi區段刪除要點備忘。vi概述 引文中並未將末行模式單獨列為一種模式。單不單列並不重要,能區分命令模式與末行模式即可。vi區段刪除步驟 1.在末行模式下使用 set nu顯示行號 非必須,隨游標移動vi右下角也會顯示行號,能夠正...
IP位址查詢
coding utf 8 ip 61.158.147.194 import urllib,urllib2,cookielib,sys,cjson reload sys sys.setdefaultencoding utf 8 url 定義介面位址,限制10qps headers headers ok...