• 大小: 0.15M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-05-03
  • 语言: C#
  • 标签: 打印机  打印  监控  

资源简介

可以监控打印机打印任务相关信息!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Printing;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
using Atom8.API.PrintSpool;


namespace Atom8.Monitors
{

    public class PrintJobChangeEventArgs : EventArgs
    {
        #region private variables
        private int _jobID=0;
        private string _jobName = ““;
        private JOBSTATUS _jobStatus = new JOBSTATUS();
        private PrintSystemJobInfo _jobInfo = null;
        #endregion

        public int JobID { get { return _jobID;}  }
        public string JobName { get { return _jobName; } }
        public JOBSTATUS JobStatus { get { return _jobStatus; } }
        public PrintSystemJobInfo JobInfo { get { return _jobInfo; } }
        public PrintJobChangeEventArgs(int intJobID string strJobName JOBSTATUS jStatus PrintSystemJobInfo objJobInfo )
            : base()
        {
            _jobID = intJobID;
            _jobName = strJobName;
            _jobStatus = jStatus;
            _jobInfo = objJobInfo;            
        }
    }

    public delegate void PrintJobStatusChanged(object Sender PrintJobChangeEventArgs e);

    public class PrintQueueMonitor  
    {
        #region DLL Import Functions
        [DllImport(“winspool.drv“ EntryPoint = “OpenPrinterA“SetLastError = true CharSet = CharSet.AnsiExactSpelling = trueCallingConvention = CallingConvention.StdCall)]
        public static extern bool OpenPrinter(String pPrinterName
        out IntPtr phPrinter
        Int32 pDefault);


        [DllImport(“winspool.drv“ EntryPoint = “ClosePrinter“
            SetLastError = true
            ExactSpelling = true
            CallingConvention = CallingConvention.StdCall)]
        public static extern bool ClosePrinter
        (Int32 hPrinter);

        [DllImport(“winspool.drv“
        EntryPoint = “FindFirstPrinterChangeNotification“
        SetLastError = true CharSet = CharSet.Ansi
        ExactSpelling = true
        CallingConvention = CallingConvention.StdCall)]
        public static extern IntPtr FindFirstPrinterChangeNotification
                            ([InAttribute()] IntPtr hPrinter
                            [InAttribute()] Int32 fwFlags
                            [InAttribute()] Int32 fwOptions
                            [InAttribute() MarshalAs(UnmanagedType.LPStruct)] PRINTER_NOTIFY_OPTIONS pPrinterNotifyOptions);

        [DllImport(“winspool.drv“ EntryPoint = “FindNextPrinterChangeNotification“
        SetLastError = true CharSet = CharSet.Ansi
        ExactSpelling = false
        CallingConvention = CallingConvention.StdCall)]
        public static extern bool FindNextPrinterChangeNotification
                            ([InAttribute()] IntPtr hChangeobject
                             [OutAttribute()] out Int32 pdwChange
                             [InAttribute() MarshalAs(UnmanagedType

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     47104  2019-04-30 15:57  PrintSpooler(印度)\.vs\PrintSpooler\v14\.suo

     文件       9847  2010-01-08 14:50  PrintSpooler(印度)\Backup\PrintQueueMonitor\PrintQueueMonitor.cs

     文件       2688  2010-01-08 12:00  PrintSpooler(印度)\Backup\PrintQueueMonitor\PrintQueueMonitor.csproj

     文件      24354  2010-01-08 12:00  PrintSpooler(印度)\Backup\PrintQueueMonitor\PrintSpoolAPI.cs

     文件       1446  2010-01-08 10:50  PrintSpooler(印度)\Backup\PrintQueueMonitor\Properties\AssemblyInfo.cs

     文件       1890  2010-01-08 14:40  PrintSpooler(印度)\Backup\PrintSpooler\MainForm.cs

     文件       3944  2010-01-08 14:30  PrintSpooler(印度)\Backup\PrintSpooler\MainForm.Designer.cs

     文件       5814  2010-01-08 14:30  PrintSpooler(印度)\Backup\PrintSpooler\MainForm.resx

     文件       4112  2010-01-08 11:02  PrintSpooler(印度)\Backup\PrintSpooler\PrintSpooler.csproj

     文件         74  2010-01-08 10:47  PrintSpooler(印度)\Backup\PrintSpooler\PrintSpooler.csproj.user

     文件        507  2010-01-08 10:48  PrintSpooler(印度)\Backup\PrintSpooler\Program.cs

     文件       1436  2010-01-08 10:47  PrintSpooler(印度)\Backup\PrintSpooler\Properties\AssemblyInfo.cs

     文件       2853  2010-01-08 10:47  PrintSpooler(印度)\Backup\PrintSpooler\Properties\Resources.Designer.cs

     文件       5612  2010-01-08 10:47  PrintSpooler(印度)\Backup\PrintSpooler\Properties\Resources.resx

     文件       1097  2010-01-08 10:47  PrintSpooler(印度)\Backup\PrintSpooler\Properties\Settings.Designer.cs

     文件        249  2010-01-08 10:47  PrintSpooler(印度)\Backup\PrintSpooler\Properties\Settings.settings

     文件       1435  2010-01-08 10:54  PrintSpooler(印度)\Backup\PrintSpooler.sln

     文件      21504  2019-04-08 13:41  PrintSpooler(印度)\PrintQueueMonitor\bin\Debug\PrintQueueMonitor.dll

     文件      22016  2019-04-08 13:41  PrintSpooler(印度)\PrintQueueMonitor\bin\Debug\PrintQueueMonitor.pdb

     文件      20992  2010-01-08 14:50  PrintSpooler(印度)\PrintQueueMonitor\bin\Release\PrintQueueMonitor.dll

     文件        816  2019-04-30 15:13  PrintSpooler(印度)\PrintQueueMonitor\obj\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6783  2019-04-08 15:58  PrintSpooler(印度)\PrintQueueMonitor\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1081  2019-04-08 16:06  PrintSpooler(印度)\PrintQueueMonitor\obj\Debug\PrintQueueMonitor.csproj.FileListAbsolute.txt

     文件       1549  2019-04-08 16:06  PrintSpooler(印度)\PrintQueueMonitor\obj\Debug\PrintQueueMonitor.csprojResolveAssemblyReference.cache

     文件      21504  2019-04-08 13:41  PrintSpooler(印度)\PrintQueueMonitor\obj\Debug\PrintQueueMonitor.dll

     文件      22016  2019-04-08 13:41  PrintSpooler(印度)\PrintQueueMonitor\obj\Debug\PrintQueueMonitor.pdb

     文件       9847  2010-01-08 14:50  PrintSpooler(印度)\PrintQueueMonitor\PrintQueueMonitor.cs

     文件       2841  2019-04-08 12:42  PrintSpooler(印度)\PrintQueueMonitor\PrintQueueMonitor.csproj

     文件      24354  2010-01-08 12:00  PrintSpooler(印度)\PrintQueueMonitor\PrintSpoolAPI.cs

     文件       1446  2010-01-08 10:50  PrintSpooler(印度)\PrintQueueMonitor\Properties\AssemblyInfo.cs

............此处省略65个文件信息

评论

共有 条评论