c# - List available network printers (non-installed as well) -
this question has answer here:
meaning able enum printers (network , local) if installed on pc
however want able list not installed , can seen using (windows built-in) add printer dialog.
is possible couldn't find useful browsing various forums/boards including stackexchange.
meaning tried built-in .net classes , wmi (select * win32_printer
) list installed printers.
thank in advance
edit: please notice suggested answer not address non-installed printers rather installed ones. able list those. thx
i not believe there in .net can this, need make native call. here msdn page how enumerate network resources, need p/invoke wnetenumresource
function netresource
objects back.
you looking objects have dwtype
of resourcetype_print
, when find them check lpremotename
name of printer.
here link a example snippet implementing use (even though url states vb code in c#). post here note on page expressly not allow copying , pasting of script without permission of author.
Comments
Post a Comment