471,357 Members | 1,210 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,357 software developers and data experts.

Printer Management using prnadmin.dll from Windows 2003 Tool Kit

Hey, could some please help me to be able to iterate through the ports on the
server. I am currently able to print test pages, add ports, delete printers
etc, but i cannot get a handle to a existing port, or iterate through a list
of ports.

im using C# and here is my code to get a handle to a port (i have registered
and added the dll to my project)

try
{
PrintMasterClass oPrinterMaster = new PrintMasterClass();
PortClass oPort = new PortClass();
//This port is a local port pointed to a network printer
oPrinterMaster.PortGet("","\\\\SERVER\\PRINTER",oP ort);
return true;
}
catch (Exception err)
{
System.Windows.Forms.MessageBox.Show(err.Message.T oString());
return false;
}
any ideas?
Jul 21 '05 #1
0 3730

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Pablo | last post: by
reply views Thread by Brett Mostert | last post: by
reply views Thread by Brett Mostert | last post: by
reply views Thread by Brett Mostert | last post: by
4 posts views Thread by Brett Mostert | last post: by
4 posts views Thread by Terry Olsen | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.