Use winsock : winsock « Windows Platform « Ruby






Use winsock


require "win32ole"

ws = WIN32OLE.new "MSWinsock.Winsock"

# Retrieve LocalIP property
ipAddress = ws.localIP

puts "The local IP is : #{ipAddress}"

 








Related examples in the same category