Hey, im busy writing a print server which needs to obviously be able to add printers, current i can add the printer port bu i cant delete ports or get a handle to them any help?
Currently im using the prnadmin.dll from the windows server 2003 resource kit.
Any help?
Here is my current code:
try
{
PrintMasterClass oPrinterMaster = new PrintMasterClass();
PortClass oPort =new PortClass();
oPrinterMaster.PortGet("",strPrinterPortName,oPort);
oPrinterMaster.PortDel(oPort);
System.Windows.Forms.MessageBox.Show(strPrinterPortName + " port deleted");
return true;
}
catch (Exception err)
{
System.Windows.Forms.MessageBox.Show(err.Message.ToString());
return false;
}