"/"+FileName); 打开文件夹并选中单个文件: System.Diagnostics.Pro ...
一 常规方法 给定一个文件路径,打开文件夹并定位到文件,通常所用shell命令为:explorer.exe select,filepath。 c 以进程启动之为: 此命令对于一般文件名是适用的,是最为简便的方法。 但项目中碰到特殊文件名,explorer.exe就不认了,它找不到,它默认跳到我的文档目录。 比如下列文件名: 它在c 代码中,unicode字符实为: 而在命令行窗口中,以explor ...
2018-02-03 11:26 0 3236 推荐指数:
"/"+FileName); 打开文件夹并选中单个文件: System.Diagnostics.Pro ...
网上一位前辈高人的一段精髓代码让我眼前一亮…… ShellExecute(NULL, "open", "explorer.exe", "/select,C:\\a.txt", NULL, SW_SHOWNORMAL); 这段代码实在是太好用了,在此mark一下。 网上还有其他的代码 ...
例如:打开“E:\Training”文件夹并选中“20131250.html”文件 System.Diagnostics.Process.Start("Explorer.exe", @"/select,E:\Training\20131250.html"); 一句代码搞定!!! 扩展 ...
FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.ShowDialog ...
直接打开指定的文件 System.Diagnostics.Process.Start(v_OpenFilePath); 直接打开目录 string v_OpenFolderPath = @"目录路径"; System.Diagnostics.Process.Start ...
C#实现【选择文件夹的保存路径】 private static string OpenFolderAndSelectFile() { string FolderPath = null; FolderBrowserDialog FbDialog = new FolderBrowserDialog ...
1、选择文件用OpenDialog 2、使用System.Windows.Forms.FolderBrowserDialog选择文件夹 3、直接打开某路径下的文件或者文件夹 <C#>_在窗体中打开文件 ...