大多數 IP 資料庫都包括 "起始 IP 範圍" 和 "結束 IP 範圍" 列。這些列中的值通常為 8 位整數。您的資料可能有由句點分隔的 9 位數字字串形式的 IP 位址。例如,1.23.456.789。若要確定 IP 位址的位置,您需要將 IP 位址轉換為整數,並確定該位址存在於哪個 IP 範圍內。
首先,您將需要在 IP 位址資料和 IP 位址資料庫之間建立兩個加入。(INT(
LEFT([IP 位址],(FIND([IP 位址], ".")))
))*16777216+
(INT(
LEFT(
MID([IP 位址],
FIND([IP 位址],".")+1),
FIND(MID([IP 位址],FIND([IP 位址],".")+1),".")-1)
))*65536+
(INT(
MID([IP 位址],
FIND([IP 位址], ".", FIND([IP 位址], ".") +1)+1,
(FIND([IP 位址], ".", FIND([IP 位址], ".", FIND([IP 位址],"." ) +1) +1)) - (FIND([IP 位址], ".", FIND([IP 位址], ".") +1))-1
)
))*256+
(INT(
RIGHT([IP 位址],
LEN([IP 位址]) -
FIND([IP 位址], ".", FIND([IP 位址], ".", FIND([IP 位址],"." ) +1) +1)
)(INT(
LEFT([IP 位址],(FIND([IP 位址], ".")))
))*16777216+
(INT(
LEFT(
MID([IP 位址],
FIND([IP 位址],".")+1),
FIND(MID([IP 位址],FIND([IP 位址],".")+1),".")-1)
))*65536+
(INT(
MID([IP 位址],
FIND([IP 位址], ".", FIND([IP 位址], ".") +1)+1,
(FIND([IP 位址], ".", FIND([IP 位址], ".", FIND([IP 位址],"." ) +1) +1)) - (FIND([IP 位址], ".", FIND([IP 位址], ".") +1))-1
)
))*256+
(INT(
RIGHT([IP 位址],
LEN([IP 位址]) -
FIND([IP 位址], ".", FIND([IP 位址], ".", FIND([IP 位址],"." ) +1) +1)
)
))001458025
40 KB
60 KB

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.