How to get hostname and IP address of local computer ? 
Author Message
 How to get hostname and IP address of local computer ?

After the dialup connection I want to know the
hostname and IP address of my computer,
can I do this?

Chang LI
Neatware



Sat, 08 Mar 2003 03:00:00 GMT  
 How to get hostname and IP address of local computer ?

Quote:

> After the dialup connection I want to know the
> hostname and IP address of my computer,
> can I do this?

This is actually not a tcl/tk question.

On linux you can get the ip adress with ifconfig.

Bye,

--
Markus Pietrek

Tel: +49-761-47094-13
Fax: +49-761-47094-29

Web: http://www.concept.de

Concept Engineering GmbH
Boetzinger Strasse 29
D-79111 Freiburg/Germany



Sat, 08 Mar 2003 03:00:00 GMT  
 How to get hostname and IP address of local computer ?

Quote:

> After the dialup connection I want to know the
> hostname and IP address of my computer,
> can I do this?

The IP address you can get with:

proc ip:adr {} {
     set me [socket -server xxx -myaddr [info hostname] 0]
     set ip [lindex [fconfigure $me -sockname] 0]
     close $me
     return $ip

Quote:
}

From the Bag of Algorithm. :-)

Bye,

--
Bernhard Wallner



Sat, 08 Mar 2003 03:00:00 GMT  
 How to get hostname and IP address of local computer ?


Quote:

>> After the dialup connection I want to know the
>> hostname and IP address of my computer,
>> can I do this?

>The IP address you can get with:

>proc ip:adr {} {
>     set me [socket -server xxx -myaddr [info hostname] 0]
>     set ip [lindex [fconfigure $me -sockname] 0]
>     close $me
>     return $ip
>}

                        .
                        .
                        .
... and the hostname is, of course, available as
  set hostname [info hostname]
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Sat, 08 Mar 2003 03:00:00 GMT  
 How to get hostname and IP address of local computer ?

Quote:

>>The IP address you can get with:

>>proc ip:adr {} {
>>     set me [socket -server xxx -myaddr [info hostname] 0]
>>     set ip [lindex [fconfigure $me -sockname] 0]
>>     close $me
>>     return $ip
>>}
> .
>... and the hostname is, of course, available as
>  set hostname [info hostname]

The [info hostname] and [lindex [fconfigure $me -sockname] 1]
are different from my NT. The first one returns the server name.
The second one returns the ISP's dynamic hostname.

Chang LI
Neatware

Quote:
>--


>Business:  http://www.Phaseit.net
>Personal:  http://starbase.neosoft.com/~claird/home.html



Sun, 09 Mar 2003 12:56:53 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. IP Address for local computer

2. getting the IP address of the local machine

3. Getting local IP address...

4. Anyway to get the server ip address not the browser ip address

5. opening ftp sessions with a different local IP address

6. local IP address

7. Getting local machine IP

8. Getting the IP Address within RB

9. getting current ip-address

10. Winsock Woes - Getting IP Address

11. Getting Client's IP Address

12. Getting the dynamic IP address of a dialup interface (ppp0)

 

 
Powered by phpBB® Forum Software