Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
CnVCL 组件包
» TCnIp可以获取本机IP列表吗?
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: TCnIp可以获取本机IP列表吗?
sibad_sh
新警察
UID 41291
Digest Posts 0
Credits 26
Posts 9
点点分 26
Reading Access 10
Registered 2008-11-17
Status Offline
#1
Post at 2009-3-31 16:31
Profile
|
Blog
|
P.M.
TCnIp可以获取本机IP列表吗?
Ip: TCnIp;
.....
Ip.IPAddress;可以获取到本机一个ip
IP.LocalIPCount;可以获取到本机有几个IP
怎么获取本机其他的IP?
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#2
Post at 2009-3-31 23:42
Profile
|
Blog
|
P.M.
先移动到CnPack组件包版了。
sibad_sh
新警察
UID 41291
Digest Posts 0
Credits 26
Posts 9
点点分 26
Reading Access 10
Registered 2008-11-17
Status Offline
#3
Post at 2009-4-1 19:29
Profile
|
Blog
|
P.M.
Passion: 帮我下忙,告诉我怎么获取其他IP?
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#4
Post at 2009-4-8 07:30
Profile
|
Blog
|
P.M.
LocalIPGroup这个动态数组就是。
kmchen
新警察
UID 42167
Digest Posts 0
Credits 12
Posts 4
点点分 12
Reading Access 10
Registered 2009-4-10
Status Offline
#5
Post at 2009-4-10 00:18
Profile
|
Blog
|
P.M.
cnip报错。
scnipname,scnpack_sesame等几个变量没有定义,是不是我没引用什么单元呀。第一次用cnpack组件,请多多原谅。谢谢。
sibad_sh
新警察
UID 41291
Digest Posts 0
Credits 26
Posts 9
点点分 26
Reading Access 10
Registered 2008-11-17
Status Offline
#6
Post at 2009-4-11 16:59
Profile
|
Blog
|
P.M.
IP := TCnIp.Create(nil);
try
for I := 0 to IP.LocalIPCount -1 do
begin
addr.S_addr := IP.LocalIPGroup[I].IPAddress;
Memo.Lines.Add(String(inet_ntoa(addr)));
end;
finally
FreeAndNil(IP);
end;
显示反过来了?
20.1.168.192
该不是还要转换吧
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#7
Post at 2009-4-11 21:31
Profile
|
Blog
|
P.M.
烦请使用IP.IntToIP(IP.LocalIPGroup[I].IPAddress);
也就是其方法:
function IntToIP(const aIP: Cardinal): string;
{* 转换整数为IP地址}
来进行转换。
sibad_sh
新警察
UID 41291
Digest Posts 0
Credits 26
Posts 9
点点分 26
Reading Access 10
Registered 2008-11-17
Status Offline
#8
Post at 2009-4-20 10:38
Profile
|
Blog
|
P.M.
谢谢Passion
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-22 06:28
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008358 second(s), 7 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats