日期:2014-05-17 浏览次数:21023 次
string filename = @"C:\test.docx";
pro = new System.Diagnostics.Process();
pro.StartInfo.CreateNoWindow = true;
pro.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
pro.StartInfo.UseShellExecute = true;
pro.StartInfo.FileName = filename;
pro.StartInfo.Verb = "print";
pro.Start();
MessageBox.Show("");//测试用的提示语句
public partial class Form1 : Form
{
System.Diagnostics.Process pro;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Print();
}
private void Print()
{
Thread t = new Thread(delegate()
{
string filename = @"C:\test.docx";
pro = new System.Diagnostics.Process();
pro.StartInfo.CreateNoWindow = true;
pro.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
pro.StartInfo.UseShellExecute = true;
pro.StartInfo.FileName = filename;
pro.StartInfo.Verb = "print";
pro.Start();
MessageBox.Show("");
});
t.IsBackground = true;
t.Start();
}
private void bu