关于命令行打印
请高手介绍一下 --------------------编程问答-------------------- http://topic.csdn.net/t/20030319/23/1552411.html --------------------编程问答-------------------- 友情帮顶,楼主网上查下 --------------------编程问答-------------------- 参考从命令行管理打印
http://technet.microsoft.com/zh-cn/library/cc782930%28WS.10%29.aspx
不过,asp.net下需要将权限提高才能执行命令后 --------------------编程问答-------------------- 更多方法参考
http://www.robvanderwoude.com/printfiles.php
--------------------编程问答-------------------- protected void Page_Load(object sender, EventArgs e)
{
Response.Write(ExeCommand("ping 192.168.155.133"));
}
public string ExeCommand(string commandText)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string strOutput = null;
try
{
p.Start();
p.StandardInput.WriteLine(commandText);
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
}
catch (Exception e)
{
strOutput = e.Message;
}
return strOutput;
} --------------------编程问答-------------------- 楼上这位仁兄,可否细说一下这段代码的意思?
补充:.NET技术 , ASP.NET