コード例 #1
0
 private static void StopSharedPrinterServerListener()
 {
     listeningForRemotePrinting = false;
     if (Configuration.OsVersion.XP == Configuration.GetOs())
     {
         ProcessControl.ExecuteCommandAsync(WinXPIECPFirewallDisable, "Firewall");
     }
     else
     {
         ProcessControl.ExecuteCommandAsync(Win7IECPFirewallDisable, "Firewall");
     }
 }
コード例 #2
0
        private static void StartSharedPrinterServerListener()
        {
            if (listeningForRemotePrinting == true)
            {
                return;
            }

            if (Configuration.OsVersion.XP == Configuration.GetOs())
            {
                ProcessControl.ExecuteCommandAsync(WinXPIECPFirewallEnable, "Firewall");
            }
            else
            {
                ProcessControl.ExecuteCommandAsync(Win7IECPFirewallEnable, "Firewall");
            }

            listeningForRemotePrinting   = true;
            remotePrintingListenerThread = new Thread(SharedPrinterListenerWorker);
            remotePrintingListenerThread.Start();
        }