如何在单击按钮时使用相应程序打开文件 [英] How to open a file with corresponding program on button click

查看:66
本文介绍了如何在单击按钮时使用相应程序打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过单击鼠标来打开文件,我想在按程序中的按钮时使用对应的Office应用程序(不在我的程序中)打开WORD(Doc)文件.我该怎么做?

I want to know how to open a file on mouse click, I want to open a WORD (Doc) file with corrseponding office application(not in my program) when pressing a button in my program. How can I do this?

推荐答案

使用 Process.Start [ ^ ]方法:
Use the Process.Start[^] method:
string myFile = @"F:\Temp\myWordDocument.doc";
Process.Start(myFile);


这篇关于如何在单击按钮时使用相应程序打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆