Display local IP address

From IronPython Cookbook

(Difference between revisions)
Line 11: Line 11:
</pre>
</pre>
-
Originally by [http://twitter.com/batok/ Domingo Aguilera]
+
Originally by [http://batok.blogspot.com/ Domingo Aguilera].
Return to [[Contents]].
Return to [[Contents]].

Revision as of 17:58, 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()

Originally by Domingo Aguilera.


Return to Contents.

TOOLBOX
LANGUAGES