try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_PrintJob");
}
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("Document: {0}", queryObj["Document"]);
}
这给出了文件名称,我需要文件的位置。