Display local IP address

From IronPython Cookbook

Revision as of 17:59, 13 July 2009 by MichaelFoord (Talk | contribs)

Showing the local IP address:

import clr
import socket
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import MessageBox
 
address = socket.gethostbyname(socket.gethostname())
MessageBox.Show(address)

Originally by Domingo Aguilera.


Return to Contents.

TOOLBOX
LANGUAGES