gpt4 book ai didi

c# - 如何在 C# 中获取打印机图标

转载 作者:行者123 更新时间:2023-11-30 21:06:01 25 4
gpt4 key购买 nike

谁能告诉我如何在 C# 中获取 PrintQueue 对象的图标(就像在资源管理器中一样)。我用这段代码得到了所有打印机的列表:

LocalPrintServer PrintServer = new LocalPrintServer();
PrintQueueCollection PrintQueuesOnLocalServer = PrintServer.GetPrintQueues(new[] { EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections });

提前致谢新克里普特

最佳答案

如果你想要一个操作系统图标,你应该尝试打开 shell32.dll(或尝试使用系统中的其他 dll)作为 Visual Studio 的资源文件,你应该在那里找到图标,但我不知道如果您可以在您的应用程序中使用。这是将 dll 作为资源打开的屏幕截图: enter image description here在这里你得到了什么:

enter image description here

当然你要试着一个一个打开图标来寻找你需要的那个,也许你想要那个叫 17 的?

enter image description here

关于c# - 如何在 C# 中获取打印机图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11413771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com