是否有我可以从应用程序( native 、Java 或 .Net)中使用的 API 或注册表项来检查当前登录的用户是否配置了默认打印机?
更新:非常感谢到目前为止的回答!根据知识库文章 http://support.microsoft.com/kb/156212 , 注册表项(读/写)仅记录到 Windows 2000。较新版本中是否有用于 native 访问的 Win API 方法?
最佳答案
在 .NET 中,这段代码适用于我:
public static string DefaultPrinterName()
{
string functionReturnValue = null;
System.Drawing.Printing.PrinterSettings oPS
= new System.Drawing.Printing.PrinterSettings();
try
{
functionReturnValue = oPS.PrinterName;
}
catch (System.Exception ex)
{
functionReturnValue = "";
}
finally
{
oPS = null;
}
return functionReturnValue;
}
来自: http://in.answers.yahoo.com/question/index?qid=20070920032312AAsSaPx
关于java - 如何检查是否有默认打印机 (Windows)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3474471/