本文介绍了我如何模仿开始 - 运行框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 是否有可能模仿VB.net中的开始 - 运行框? 具体来说,我试图模仿按下Win + R,输入 notepad ++C:\ Users \Steven \Documents\config.cfg并点击返回。 这可能吗? 我尝试过使用 System.Diagnostics.Process.Start( notepad ++C:\ Users \Steven \Documents\config.cfg) 和 System.Diagnostics.Process.Start( notepad ++ C:\ Users \Steven \Documents\config.cfg) 我收到错误,说系统找不到指定的文件。 我尝试过使用 Shell( notepad ++C:\ Users \Steven \Documents\config.cfg) 和 Shell( notepad ++ C: \ Users \Steven \Documents\config.cfg) 我收到错误说找不到两个文件。 当我在运行中键入notepad ++C:\ Users \Steven \Documents\config.cfg时框和按回车,它打开没有问题。 有谁知道怎么做?解决方案 尝试下面 System.Diagnostics.Process.Start( notepad ++。exe, C:\ Users \Steven \Documents \ config.cfg) 试试这个: System.Diagnostics.Process.Start( notepad ++, @ C:\ Users \Steven \Documents\config.cfg) Is it possible to mimic the Start - Run box in VB.net?Specifically, I'm trying to mimic pressing Win+R, typingnotepad++ "C:\Users\Steven\Documents\config.cfg" and hitting return.Is this possible?I've tried usingSystem.Diagnostics.Process.Start("notepad++ ""C:\Users\Steven\Documents\config.cfg""")andSystem.Diagnostics.Process.Start("notepad++ C:\Users\Steven\Documents\config.cfg")and I get an error saying "The system cannot find the file specified" for both of them.I've tried usingShell("notepad++ ""C:\Users\Steven\Documents\config.cfg""")andShell("notepad++ C:\Users\Steven\Documents\config.cfg")and I get an error saying "File not found" for both of them.When I type notepad++ "C:\Users\Steven\Documents\config.cfg" in the run box and press return, it opens without a problem.Does anyone know how to do this? 解决方案 try below System.Diagnostics.Process.Start( "notepad++.exe", "C:\Users\Steven\Documents\config.cfg")Try this:System.Diagnostics.Process.Start("notepad++", @"C:\Users\Steven\Documents\config.cfg") 这篇关于我如何模仿开始 - 运行框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-13 17:49