winfrom 默认应用程序打开文件
try
{
System.Diagnostics.Process.Start(fullpath);
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); return; }
本文介绍了一种在WinForm应用程序中使用默认关联程序打开文件的方法。通过调用System.Diagnostics.Process.Start()方法并传入文件的完整路径,可以实现这一功能。同时,本文还提供了异常处理代码确保操作的安全性。
winfrom 默认应用程序打开文件
try
{
System.Diagnostics.Process.Start(fullpath);
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); return; }