tags:

views:

49

answers:

1

Is there a native C# (managed) way to add a printer to Windows? I've found a reference to using

[DllImport("winspool.drv",CharSet=CharSet.Auto)]
private static extern IntPtr AddPrinter(string myserver, 
   uint dwLevel, ref PRINTER_INFO_2 pi );

But I'd rather avoid linking into the unmanaged library. Is this my only option for adding a printer in .NET 2.0?

+2  A: 

Can you check if this link helps you -

http://www.developerfusion.com/article/5450/using-wmi-from-managed-code/2/

Sachin Shanbhag
I think this is the only managed way so far :) +1
Nayan