C#如何调用Windows程序打开一个文档
可以使用Explorer.exe进行来进行相关操作,Explorer.exe会调用相关的程序打开文档。代码如下:
private void OpenWindowsExplorer(string urlorpath)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = “explorer.exe”;
startInfo.Arguments = urlorpath;
try
{
Process.Start(startInfo);
}
catch (Exception e)
{
MessageBox.Show(“Error”);
}
}
private void OpenWindowsExplorer(string urlorpath)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = “explorer.exe”;
startInfo.Arguments = urlorpath;
try
{
Process.Start(startInfo);
}
catch (Exception e)
{
MessageBox.Show(“Error”);
}
}
【C#如何调用Windows程序打开一个文档】相关文章
3. 以下为Windows NT 下的32 位C++程序,请计算sizeof 的值
4. 写一个方法,输入一个文件名和一个字符串,统计这个字符串在这个文件中出现的次数
6. Windows系统面试题
10. WEB控件及HTML服务端控件能否调用客户端方法?如果能,请解释如何调用?
本文来源:https://www.mianshiwenti.com/a13012.html
进入下载页面
上一篇:抽象类和接口的区别
下一篇:成都思必达公司C#程序员招聘面试题
﹝C#如何调用Windows程序打开一个文档﹞相关内容
- JAVA语言如何进行异常处理,关键字:throws,throw,try,catch,finally分别代表什么意义?在try块中可以抛出异常吗?
- 关键字throw与throws的用法差异
- Java如何调用外部Exe程序
- 软件测试LoadRunner面试题:If you want to stop the execution of your script on error, how do you do that?
- XML文档定义有几种形式?它们之间有何本质区别?解析XML文档有哪几种方式?
- 如何在C# winform中异步调用web services
- How to detect and cleanup pending transactions in Oracle
- 软件测试LoadRunner面试题:What do vuser_init action and vuser_end action contain?
- 如何反序的迭代一个序列?how do I iterate over a sequence in reverse order
- 软件测试LoadRunner面试题:What is the difference between standard log and extended log?