這個IP庫實測還是比較準確的,免費版的可以具體到國內城市,國外只能到國家名稱,免費版的自己定期更新Ip資料庫即可,
以下為C#呼叫代碼
class Program
{
static void Main(string[] args)
{
try
{
//傳入要查詢的ip 和17monipdb.datx 下載的ip庫所在位置
string address = IPAddress.FindIPAddress("1.198.219.205", @"D:\開發資料\資料\Code\IP地址獲取\IPAddress\IPAddress\bin\Debug");
Console.WriteLine(address);
}
catch (IOException ioex)
{
Console.WriteLine(ioex.StackTrace);
}
catch (IPv4FormatException ipex)
{
Console.WriteLine(ipex.StackTrace);
}
Console.ReadKey(true);
}
}
public class IPAddress
{
public static string FindIPAddress(string ip,string basePath)
{
string address = "";
if (string.IsNullOrEmpty(ip))
{
return address;
}
try
{
string path = string.Format("{0}\\{1}", basePath, "17monipdb.datx");
City city = new City(path);
string[] arr = city.find(ip);
if (arr != null && arr.Length > 0)
{
address = string.Join("-", arr);
}
}
catch (IOException ioex)
{
Console.WriteLine(ioex.StackTrace);
}
catch (IPv4FormatException ipex)
{
Console.WriteLine(ipex.StackTrace);
}
return address.TrimEnd("-".ToCharArray());
}
}
IPIP.net官網在這
戳戳戳
————————————————
著作權宣告:本文為CSDN博主「皮皮蝦大俠」的原創文章,遵循 CC 4.0 BY-SA 著作權協議,轉載請附上原文出處鏈接及本宣告,
原文鏈接:https://blog.csdn.net/Asa_Jim/article/details/94394612 是本人CSDN原創
- 23
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
<style>body { font-size: 62.5%; margin: 1em }
ul { list-style: none; margin: 0; padding: 0 }
#watch { font-size: 1em; position: relative }
#watch .frame-face { position: relative; width: 30em; height: 30em; margin: 2em auto; border-radius: 15em; background: linear-gradient(180deg, rgba(249, 249, 249, 1), rgba(102, 102, 102, 1)); box-shadow: 0.5em 0.5em 4em rgba(0, 0, 0, 0.8) }
#watch .frame-face:before { content: ""; width: 29.4em; height: 29.4em; border-radius: 14.7em; position: absolute; top: 0.3em; left: 0.3em; background: linear-gradient(135deg, rgba(246, 248, 249, 0) 0, rgba(229, 235, 238, 1) 50%, rgba(205, 212, 217, 1) 51%, rgba(245, 247, 249, 0) 100%), radial-gradient(rgba(246, 248, 249, 1) 0, rgba(229, 235, 238, 1) 65%, rgba(205, 212, 217, 1) 66%, rgba(245, 247, 249, 1) 100%) }
#watch .frame-face:after { content: ""; width: 28em; height: 28em; border-radius: 14.2em; position: absolute; top: 0.9em; left: 0.9em; box-shadow: inset 0.2em 0.2em 1em rgba(0, 0, 0, 0.2); border: 0.1em solid rgba(0, 0, 0, 0.2); background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(204, 204, 204, 1)) }
#watch .minute-marks li { display: block; width: 0.2em; height: 0.6em; background: rgba(146, 147, 148, 1); position: absolute; top: 50%; left: 50%; margin: -0.4em 0 0 -0.1em }
#watch .minute-marks li:first-child { transform: rotate(6deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+2) { transform: rotate(12deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+3) { transform: rotate(18deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+4) { transform: rotate(24deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+5) { transform: rotate(36deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+6) { transform: rotate(42deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+7) { transform: rotate(48deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+8) { transform: rotate(54deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+9) { transform: rotate(66deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+10) { transform: rotate(72deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+11) { transform: rotate(78deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+12) { transform: rotate(84deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+13) { transform: rotate(96deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+14) { transform: rotate(102deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+15) { transform: rotate(108deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+16) { transform: rotate(114deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+17) { transform: rotate(126deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+18) { transform: rotate(132deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+19) { transform: rotate(138deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+20) { transform: rotate(144deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+21) { transform: rotate(156deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+22) { transform: rotate(162deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+23) { transform: rotate(168deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+24) { transform: rotate(174deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+25) { transform: rotate(186deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+26) { transform: rotate(192deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+27) { transform: rotate(198deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+28) { transform: rotate(204deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+29) { transform: rotate(216deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+30) { transform: rotate(222deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+31) { transform: rotate(228deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+32) { transform: rotate(234deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+33) { transform: rotate(246deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+34) { transform: rotate(252deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+35) { transform: rotate(258deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+36) { transform: rotate(264deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+37) { transform: rotate(276deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+38) { transform: rotate(282deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+39) { transform: rotate(288deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+40) { transform: rotate(294deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+41) { transform: rotate(306deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+42) { transform: rotate(312deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+43) { transform: rotate(318deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+44) { transform: rotate(324deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+45) { transform: rotate(336deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+46) { transform: rotate(342deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+47) { transform: rotate(348deg) translateY(-12.7em) }
#watch .minute-marks li:nth-child(0n+48) { transform: rotate(354deg) translateY(-12.7em) }
#watch .digits { width: 30em; height: 30em; border-radius: 15em; position: absolute; top: 0; left: 50%; margin-left: -15em }
#watch .digits li { font-size: 1.6em; display: block; width: 1.6em; height: 1.6em; position: absolute; top: 50%; left: 50%; line-height: 1.6em; text-align: center; margin: -0.8em 0 0 -0.8em; font-weight: bold }
#watch .digits li:nth-child(0n+1) { transform: translate(3.9em, -6.9em) }
#watch .digits li:nth-child(0n+2) { transform: translate(6.9em, -4em) }
#watch .digits li:nth-child(0n+3) { transform: translate(8em, 0) }
#watch .digits li:nth-child(0n+4) { transform: translate(6.8em, 4em) }
#watch .digits li:nth-child(0n+5) { transform: translate(3.9em, 6.9em) }
#watch .digits li:nth-child(0n+6) { transform: translate(0, 8em) }
#watch .digits li:nth-child(0n+7) { transform: translate(-3.9em, 6.9em) }
#watch .digits li:nth-child(0n+8) { transform: translate(-6.8em, 4em) }
#watch .digits li:nth-child(0n+9) { transform: translate(-8em, 0) }
#watch .digits li:nth-child(0n+10) { transform: translate(-6.9em, -4em) }
#watch .digits li:nth-child(0n+11) { transform: translate(-3.9em, -6.9em) }
#watch .digits li:nth-child(0n+12) { transform: translate(0, -8em) }
#watch .digits:before { content: ""; width: 1.6em; height: 1.6em; border-radius: 0.8em; position: absolute; top: 50%; left: 50%; margin: -0.8em 0 0 -0.8em; background: rgba(18, 19, 20, 1) }
#watch .digits:after { content: ""; width: 4em; height: 4em; border-radius: 2.2em; position: absolute; top: 50%; left: 50%; margin: -2.1em 0 0 -2.1em; border: 0.1em solid rgba(198, 198, 198, 1); background: radial-gradient(rgba(200, 200, 200, 0), rgba(190, 190, 190, 1) 90%, rgba(130, 130, 130, 1) 100%) }
@keyframes hours { 100% { transform: rotate(335deg) } }
#watch .hours-hand { width: 0.8em; height: 7em; border-radius: 0 0 0.9em 0.9em; background: rgba(35, 36, 37, 1); position: absolute; bottom: 50%; left: 50%; margin: 0 0 -0.8em -0.4em; box-shadow: 0 0 2px rgba(35, 36, 37, 1); transform-origin: 0.4em 6.2em; transform: rotate(-25deg); animation: 43200s linear 0s infinite hours }
#watch .hours-hand:before { content: ""; width: 1.8em; height: 0.8em; border-radius: 0 0 0.8em 0.8em; box-shadow: 0 0 1px rgba(35, 36, 37, 1); position: absolute; top: -0.7em; left: -0.5em }
#watch .hours-hand:after { content: ""; width: 0; height: 0; border-top: 0 solid rgba(35, 36, 37, 1); border-right: 0.9em solid rgba(0, 0, 0, 0); border-bottom: 2.4em solid rgba(35, 36, 37, 1); border-left: 0.9em solid rgba(0, 0, 0, 0); position: absolute; top: -3.1em; left: -0.5em }
@keyframes minutes { 100% { transform: rotate(422deg) } }
#watch .minutes-hand { width: 0.8em; height: 12.5em; border-radius: 0.5em; background: rgba(52, 53, 54, 1); position: absolute; bottom: 50%; left: 50%; margin: 0 0 -1.5em -0.4em; box-shadow: 0 0 2px rgba(52, 53, 54, 1); transform-origin: 0.4em 11em; transform: rotate(62deg); animation: 3600s linear 0s infinite minutes }
@keyframes seconds { 100% { transform: rotate(480deg) } }
#watch .seconds-hand { width: 0.2em; height: 14em; border-radius: 0.1em 0.1em 0 0 / 10em 10em 0 0; background: rgba(204, 0, 0, 1); position: absolute; bottom: 50%; left: 50%; margin: 0 0 -2em -0.1em; box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.8); transform-origin: 0.1em 12em; transform: rotate(120deg); animation: 60s steps(60) 0s infinite seconds }
#watch .seconds-hand:after { content: ""; width: 1.4em; height: 1.4em; border-radius: 0.7em; position: absolute; left: -0.65em; bottom: 1.35em }
#watch .seconds-hand:before { content: ""; width: 0.8em; height: 3em; border-radius: 0.2em 0.2em 0.4em 0.4em / 0.2em 0.2em 2em 2em; box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.8); position: absolute; left: -0.35em; bottom: -3em }
#watch .digital-wrap { width: 9em; height: 3em; border: 0.1em solid rgba(34, 34, 34, 1); border-radius: 0.2em; position: absolute; top: 50%; left: 50%; margin: 3em 0 0 -4.5em; overflow: hidden; background: linear-gradient(180deg, rgba(76, 76, 76, 1) 0, rgba(15, 15, 15, 1) 100%) }
#watch .digital-wrap ul { float: left; width: 2.85em; height: 3em; border-right: 0.1em solid rgba(0, 0, 0, 1); color: rgba(221, 221, 221, 1); font-family: Consolas, monaco, monospace }
#watch .digital-wrap ul:last-child { border: none }
#watch .digital-wrap li { font-size: 1.5em; line-height: 2; letter-spacing: 2px; text-align: center; position: relative; left: 1px }
#watch .digit-minutes li { animation: 3600s steps(60) 0s infinite dsm }
#watch .digit-seconds li { animation: 60s steps(60) 0s infinite dsm }
@keyframes dsm { 100% { transform: translateY(-120em) } }</style>
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/96181.html
標籤:C#
上一篇:C#呼叫科大訊飛離線語音合成問題
下一篇:C#啟動外部表單(如excel)并嵌入主程式表單