内のマシンに障害が発生したのはなぜスタートとを下記の通り/停止:LocalPrintServer.GetDefaultPrintQueueは()私は、単純なWindowsサービス(ログオン:ローカルシステム)を持っているドメイン
protected override void OnStart(string[] args)
{
EventLog.WriteEntry(SOURCE, "Start");
var queue = LocalPrintServer.GetDefaultPrintQueue();
}
protected override void OnStop()
{
EventLog.WriteEntry(SOURCE, "Stop");
}
それは私の地元の勝利7上で動作します(x64の)が、Windows 7(x64)のドメインでは起動できません。 私は例外を参照してください。
Service cannot be started. System.Printing.PrintServerException: An exception occurred while getting the default printer. Win32 error: The system cannot find the file specified. at System.Printing.LocalPrintServer.GetDataFromServer(String property, Boolean forceRefresh) at System.Printing.LocalPrintServer.GetUnInitializedData(String[] properties) at System.Printing.LocalPrintServer.get_DefaultPrintQueue() at System.Printing.LocalPrintServer.GetDefaultPrintQueue() at blablabla.Service1.OnStart(String[] args) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
は、誰もがそれに役立つことはできますか? ありがとうございます。
p.s. LocalSystemにはプロファイルがあるはずです。そして私は、私はのように、デフォルトのプリンタの不足に対処すべきだと思う...そして
...
うーん、私は '新しいPrinterSettings(試す)PrinterName'それは私に語った:「デフォルトのプリンタが設定されていません」 – Vladimir