Converting script into VB.Net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dvp10
    New Member
    • Jan 2008
    • 10

    Converting script into VB.Net

    I want to conert the following script in VB.Net..
    I m not getting it properly.
    Can anybody have idea.



    On Error Resume Next

    Const ALLOW_ALL = 0

    strComputer = "."
    Set objWMIService = GetObject("winm gmts:" _
    & "{impersonation Level=impersona te}!\\" & strComputer & "\root\cimv 2")

    Set colNetCards = objWMIService.E xecQuery _
    ("Select * From Win32_NetworkAd apterConfigurat ion Where IPEnabled = True")

    For Each objNetCard in colNetCards
    arrPermittedTCP Ports = Array(ALLOW_ALL )
    arrPermittedUDP Ports = Array(ALLOW_ALL )
    arrPermittedIPP rotocols = Array(ALLOW_ALL )
    objNetCard.Enab leIPSec arrPermittedTCP Ports, arrPermittedUDP Ports, _
    arrPermittedIPP rotocols
    Next
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Originally posted by dvp10
    I want to conert the following script in VB.Net..
    I m not getting it properly.
    Can anybody have idea.



    On Error Resume Next

    Const ALLOW_ALL = 0

    strComputer = "."
    Set objWMIService = GetObject("winm gmts:" _
    & "{impersonation Level=impersona te}!\\" & strComputer & "\root\cimv 2")

    Set colNetCards = objWMIService.E xecQuery _
    ("Select * From Win32_NetworkAd apterConfigurat ion Where IPEnabled = True")

    For Each objNetCard in colNetCards
    arrPermittedTCP Ports = Array(ALLOW_ALL )
    arrPermittedUDP Ports = Array(ALLOW_ALL )
    arrPermittedIPP rotocols = Array(ALLOW_ALL )
    objNetCard.Enab leIPSec arrPermittedTCP Ports, arrPermittedUDP Ports, _
    arrPermittedIPP rotocols
    Next
    Is this VB6? Do you have VS2003? Have you tried a converter?

    Comment

    • dvp10
      New Member
      • Jan 2008
      • 10

      #3
      i have VS2005
      I havent tried converter yet

      Comment

      Working...