10.4. 调用资源管理器打开文件夹并选中文件:openFolderAndSelectFile


    //open folder and select file
    public void openFolderAndSelectFile(string fullFilename)
    {
        System.Diagnostics.Process.Start("Explorer.exe", "/select," + fullFilename);
    }

    

例 10.4. openFolderAndSelectFile 的使用范例


            string outputFilename = txbExpAlertFilename.Text + ".xls";
            string fullFilename = Path.Combine(saveFolderPath, outputFilename);
            //......
            crifanLib.openFolderAndSelectFile(fullFilename);