C#打开指定目录,并将焦点放在指定文件上。相对路径(程序起动的目录)
string basepath = AppDomain.CurrentDomain.BaseDirectory; string filepath = "logs\\Log.log"; string path = basepath + filepath; // System.Diagnostics.Process.Start("explorer.exe", path); System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe"); psi.Arguments = "/e,/select," + path; System.Diagnostics.Process.Start(psi);