Thread eigene IP (12 answers)
Opened by Strazke at 2005-09-08 18:41

esskar
 2005-09-08 19:28
#38473 #38473
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
windows?
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl  

use Socket;
use strict;

sub ShowIPLocalInfo
{
my @hostent = gethostbyname(undef) or return 0;

print "name: ",shift @hostent,"\n"; # the name
print "alias: ",shift @hostent,"\n"; # not always available
print "addrtype: ",shift @hostent,"\n";
print "length: ",shift @hostent,"\n";

print "\nOwn Ip-Addresses:\r\n";
print "\t",inet_ntoa($_), "\n" foreach (@hostent);
}

ShowIPLocalInfo();

View full thread eigene IP