viewpoint-particle

Author Topic: System.Net [this weeks journey into WB CLR]  (Read 88 times)

stanl

  • Pundit
  • *****
  • Posts: 889
System.Net [this weeks journey into WB CLR]
« on: March 03, 2019, 11:38:38 am »
Code: Winbatch

;Winbatch 2018B - Using CLR to To Obtain IP Address with System.Net
;Stan Littlefield 3/3/2019
;==================================================================
ObjectClrOption("useany","System.Net")
oDNS = ObjectClrNew("System.Net.Dns")
oAddress = oDNS.GetHostByName("")
ipaddress = ""


ForEach a in oAddress.AddressList
   ipaddress = ipaddress:a.ToString:@LF
Next


Message("Ip Addresses - home",ipaddress)


oAddress = oDNS.GetHostByName("microsoft.com")
ipaddress = ""


ForEach a in oAddress.AddressList
   ipaddress = ipaddress:a.ToString:@LF
Next


Message("Ip Addresses - Microsoft",ipaddress)


oAddress=0
oDNS=0


Exit
;==================================================================