Программно устанавливаем принтер через WMI: Справочник по C#

0
class printport { string DeviceID; string DriverName; string PortName; Boolean Shared; string ShareName; private ManagementScope managementScope = null; private ManagementClass InitClass(string className) { //specify Printer class management path ManagementPath managementPath = new ManagementPath(className); try { //create new WMI...

Получаем серийный номер принтера через SNMP: Справочник по C#

0
public void SNMPserial(string ip) { try { arrSNMP = string.Empty; OctetString community = new OctetString("public"); AgentParameters param = new AgentParameters(community); param.Version = SnmpVersion.Ver1; IpAddress agent = new IpAddress(ip);//IP address UdpTarget target = new...

Подключение к SQL серверу HP Web JetAdmin: Справочник по C#

0
      В данной инструкции рассмотрим подключение к SQL базе данных, утилиты НР Web JetAdmin и получение всех ip адресов сетевых принтеров которые...

Переименовываем принтер через WMI: Справочник по C#

0
public static void RenamePrinter(string sPrinterName, string newName) { ManagementScope oManagementScope = new ManagementScope(ManagementPath.DefaultPath); oManagementScope.Connect(); SelectQuery oSelectQuery = new SelectQuery(); oSelectQuery.QueryString = @"SELECT * FROM Win32_Printer WHERE Name = '" +...

Установка принтера по умолчанию: Справочник по C#

0
/// /// method to set a specified printer as the system's default printer /// /// name of the printer we want to be default/// Returns...

Вывод сообщения на дисплей принтера от производителя Hewlett Packard: Справочник по C#

0
      В данной инструкции будет рассказано, как вывести ваше сообщение на дисплей принтера от производителя Hewlett Packard. Делается это при помощи отправки...

Получение MAC адреса через SNMP: Справочник по C#

0
public void SNMPmac(string ip) { try { Pdu pdu; SnmpV1Packet result; arrSNMP = string.Empty; OctetString community = new OctetString("public"); AgentParameters param = new AgentParameters(community); param.Version = SnmpVersion.Ver1; IpAddress agent = new IpAddress(ip);//IP address UdpTarget target...

Программно добавляем порт принтера с помощью WMI: Справочник по C#

0
public void AddPrinterPort() { ConnectionOptions connectionOptions; ManagementPath managementPath; ManagementScope managementScope; ManagementObject port; PutOptions putOptions; try { connectionOptions = new ConnectionOptions(); connectionOptions.EnablePrivileges = true; connectionOptions.Impersonation = System.Management.ImpersonationLevel.Impersonate; managementPath = new ManagementPath("Win32_TCPIPPrinterPort"); managementScope = new ManagementScope(@".rootcimv2", connectionOptions); managementScope.Options.EnablePrivileges = true; managementScope.Options.Impersonation = System.Management.ImpersonationLevel.Impersonate; port =...

Получаем время работы принтера через SNMP: Справочник по C#

0
public void SNMPupTime(string ip) { try { arrSNMP = string.Empty; OctetString community = new OctetString("public"); AgentParameters param = new AgentParameters(community); param.Version = SnmpVersion.Ver1; IpAddress agent = new IpAddress(ip);//IP address UdpTarget target = new...

Check if a printer is offline or online: Справочник по C#

0
public bool IsPrinterOnline(string printerName) { string str = ""; bool online = false; //set the scope of this search to the local machine ManagementScope scope = new ManagementScope(ManagementPath.DefaultPath); //connect to...

Список установленных притеров: Справочник по C#

0
public List GetInstalledPrinters() { List printerList = new List(); try { //set the scope of this search to the local machine ManagementScope scope = new ManagementScope(ManagementPath.DefaultPath); //connect to the machine scope.Connect(); //build the...

Удаляем принтер через WMI: Справочник по C#

0
public static bool DeletePrinter(string sPrinterName) { ManagementScope oManagementScope = new ManagementScope(ManagementPath.DefaultPath); oManagementScope.Connect(); SelectQuery oSelectQuery = new SelectQuery(); oSelectQuery.QueryString = @"SELECT * FROM Win32_Printer WHERE Name = '" + sPrinterName.Replace("", "\")...

ЭТО ИНТЕРЕСНО