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);

 

posted @ 2013-06-28 08:50  shenghaishiweini  阅读(277)  评论(0编辑  收藏  举报