打开使用的Process.Start文件夹 [英] Open a folder using Process.Start

查看:138
本文介绍了打开使用的Process.Start文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到其他话题和我有另一问题..这个过程已经开始(在任务管理器锯),但该文件夹无法打开,我的屏幕上。

I saw the other topic and I'm having another problem .. The process is starting(saw at task manager) but the folder is not opening on my screen ..

System.Diagnostics.Process.Start("explorer.exe",@"c:\teste");

怎么了?

编辑:替换成'//'为'/',仍然只有开始的过程@任务管理器,文件夹是不开放。

Edited: Replaced '//' for '/', still starting only the process @ task manager, folder is not opening ..

推荐答案

你有没有确信的文件夹 C:\\睾丸的存在?如果没有,资源管理器将打开,显示一些默认的文件夹(在我的情况 C:\\用户\\ [用户​​名] \\文件)。

Have you made sure that the folder "c:\teste" exists? If it doesn't, explorer will open showing some default folder (in my case "C:\Users\[user name]\Documents").

更新

我曾尝试以下变化:

// opens the folder in explorer
Process.Start(@"c:\temp");
// opens the folder in explorer
Process.Start("explorer.exe", @"c:\temp");
// throws exception
Process.Start(@"c:\does_not_exist");
// opens explorer, showing some other folder)
Process.Start("explorer.exe", @"c:\does_not_exist");

如果没有这些(当然,除了抛出异常的那个)在电脑上工作,我不认为问题出在code,但在环境中。如果是这样的话,我会尝试下面的一个(或两个):

If none of these (well, except the one that throws an exception) work on your computer, I don't think that the problem lies in the code, but in the environment. If that is the case, I would try one (or both) of the following:


  • 打开运行对话框,输入explorer.exe的并回车

  • 打开一个命令提示符,输入explorer.exe的并回车

这篇关于打开使用的Process.Start文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆