可能重复:
How to get the original full file path been printed by Spooler API
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_PrintJob");
}
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("Document: {0}", queryObj["Document"]);
}
这给出了文档名称,我需要文件的位置。