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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -