asacyra
02-04-2020, 12:08
Добрый день.
Пишу программу по массовой установке принтеров. Да я понимаю что это костыль, но адреса постоянны в двух принт серверах
160859
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace Printer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void pprint_Click(object sender, EventArgs e)
{
this.printer1.Text = this.ip_adr.Text + (".20");
this.printer2.Text = this.ip_adr.Text + (".21");
this.printer3.Text = this.ip_adr.Text + (".22");
this.printer4.Text = this.ip_adr.Text + (".23");
this.printer5.Text = this.ip_adr.Text + (".24");
this.printer6.Text = this.ip_adr.Text + (".25");
}
private void button1_Click_1(object sender, EventArgs e)
{
System.Diagnostics.Process pprint1 = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo();
startinfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startinfo.FileName = "cmd.exe";
\\Ниже пытаюсь собрать команду, но на ум ничего не идет и в документации найти не могу. Кусок выделил красным
startinfo.Arguments = "/c cscript c:\\prnport.vbs - a - r IP_mobile1 - h" + printer2.Text + ("- o RAW - n 9100");
pprint1.StartInfo = startinfo;
pprint1.Start();
}
}
}
Пишу программу по массовой установке принтеров. Да я понимаю что это костыль, но адреса постоянны в двух принт серверах
160859
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace Printer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void pprint_Click(object sender, EventArgs e)
{
this.printer1.Text = this.ip_adr.Text + (".20");
this.printer2.Text = this.ip_adr.Text + (".21");
this.printer3.Text = this.ip_adr.Text + (".22");
this.printer4.Text = this.ip_adr.Text + (".23");
this.printer5.Text = this.ip_adr.Text + (".24");
this.printer6.Text = this.ip_adr.Text + (".25");
}
private void button1_Click_1(object sender, EventArgs e)
{
System.Diagnostics.Process pprint1 = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startinfo = new System.Diagnostics.ProcessStartInfo();
startinfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startinfo.FileName = "cmd.exe";
\\Ниже пытаюсь собрать команду, но на ум ничего не идет и в документации найти не могу. Кусок выделил красным
startinfo.Arguments = "/c cscript c:\\prnport.vbs - a - r IP_mobile1 - h" + printer2.Text + ("- o RAW - n 9100");
pprint1.StartInfo = startinfo;
pprint1.Start();
}
}
}