i will like to ask if anyone can convert this simple vb script to c# :i im a beginner so it would be nice to have an example.
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objNewPort = objWMIService.Get _ ("Win32_TCPIPPrinterPort").SpawnInstance_ objNewPort.Name = "IP_10.10.10.113" objNewPort.Protocol = 1 objNewPort.HostAddress = "10.10.10.113" objNewPort.PortNumber = "9100" objNewPort.SNMPEnabled = False objNewPort.Put_ Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_ objPrinter.DriverName = "HP LaserJet 4000 Series PS" objPrinter.PortName = "IP_10.10.10.113" objPrinter.DeviceID = "FrontOffice" objPrinter.Network = True objPrinter.Put_
//Thanks :)
Loading

VulpesRank #55 · 29.2K reputationPosted Nov 13, 2012, 5:27 AM EST
// ...
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 9, 2012, 5:54 AM EST
jesper89 reputationPosted Nov 9, 2012, 12:25 PM EST
VulpesRank #55 · 29.2K reputationPosted Nov 11, 2012, 11:13 AM EST
I can't promise that it will work but try this:
using System.Management;
// ....
jesper89 reputationPosted Nov 12, 2012, 11:39 PM EST