.net5 winform 打开文件夹

 

直接使用System.Diagnostics.Process.Start("路径"),有可能会包拒绝访问的异常,建议采用以下写法:

var  newPath=“”;

var psi = new System.Diagnostics.ProcessStartInfo() { FileName = newPath, UseShellExecute = true };
System.Diagnostics.Process.Start(psi);

posted @ 2021-12-22 16:16  就一个  阅读(329)  评论(0编辑  收藏  举报