首页
论坛
新职位
搜索论坛
什么是新的
新职位
新的个人资料帖子
最新活动
会员
目前的访客
新的个人资料帖子
搜索个人资料帖子
VB.NET社区
登录
寄存器
什么是新的
搜索
搜索
仅搜索标题
通过:
新职位
搜索论坛
Menu
Log in
Register
安装应用
安装
首页
论坛
C#
Windows表格
如何给文件夹中的文件链接。
您正在使用过期的浏览器。它可能无法正确显示此网站或其他网站。
您应该升级或使用
替代浏览器
.
回复主题
信息
<blockquote data-quote="Skydiver" data-source="post: 16157" data-attributes="member: 11639"><p>"explorer.exe" is the the Windows File Explorer process. When you start "explorer.exe" and pass it the name of file, it will try to show you a view of that folder. Give it a try: open a CMD window, and type in "explorer.exe C:\Windows\System32" and it should show you a view of your C:\Windows\System32 folder.</p><p></p><p>So there is a little bit of magic when you call [icode]Process.Start()[/icode] and how it processes what you pass in. You can read about in the <a href="//docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=netcore-3.1#System_Diagnostics_Process_Start_System_String_">documentation</a>:</p><p></p><p></p><p>Also, on reading the documentation, I gave you bad advice of using this approach:</p><p>[code]</p><p>string folderName = Path.Combine(Environment.CurrentDirectory, "documents");</p><p>Process.Start($@"explorer.exe ""{folderName}""");</p><p>[/code]</p><p>as per the documentation, it should have been this instead:</p><p>[code]</p><p>string folderName = Path.Combine(Environment.CurrentDirectory, "documents");</p><p>Process.Start("explorer.exe", folderName);</p><p>[/code]</p><p>using two parameters instead of just a single string.</p></blockquote><p></p>
Insert quotes…
验证
发表回复
首页
论坛
C#
Windows表格
如何给文件夹中的文件链接。
本网站使用Cookie来帮助个性化内容,调整您的体验并在注册时保持登录状态。
继续使用本网站,即表示您同意我们使用cookie。
接受
了解更多…
最佳
底部