Display local IP address

From IronPython Cookbook

(Difference between revisions)
MichaelFoord (Talk | contribs)
(New page: Showing the local IP address: <pre> import clr import socket clr.AddReference("System.Windows.Forms") from System.Windows.Forms import Application, MessageBox MessageBox.Show(socket.get...)
Newer edit →

Revision as of 16:08, 13 July 2009

Showing the local IP address:

import clr
import socket
clr.AddReference("System.Windows.Forms")

from System.Windows.Forms import Application, MessageBox
 
MessageBox.Show(socket.gethostbyname(socket.gethostname()))
Application.Run()


Return to Contents.

TOOLBOX
LANGUAGES