由于我现在无法进入的原因,我需要防止在我尝试打印文档时打开 Adobe Reader 窗口。在我之前从事此工作的开发人员设置了以下标志,尽管我不确定它们的用途 -
if (RegistryManager.GetAcrobatVersion() >= 9.0f)
printerArg = "\"" + printerName + "\"";
else
printerArg = printerName;
Process myProc = new Process();
myProc.StartInfo.FileName = fileName;
myProc.StartInfo.Verb = "printto";
myProc.StartInfo.UseShellExecute = true;
myProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
myProc.StartInfo.CreateNoWindow = true;
myProc.StartInfo.Arguments = "\"" + printerName + "\"";
bool result = myProc.Start();
if (myProc.WaitForInputIdle())
{
if (!myProc.HasExited)
{
myProc.WaitForExit(Convert.ToInt32(5000));
myProc.Kill();
}
}
myProc.Close();
任何帮助深表感谢!
谢谢,
泰加。