我正在创建一个 .NET Core 控制台应用程序来运行命令。
public bool RunCommand()
{
try
{
var procStartInfo = new ProcessStartInfo("exec", "cal")
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = false
};
var proc = new Process { StartInfo = procStartInfo };
proc.Start();
// Get the output into a string
output = proc.StandardOutput.ReadToEnd();
return proc.ExitCode == decimal.Zero ? true : false;
}
finally
{
// do something
}
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误 -
Unhandled Exception: System.ComponentModel.Win32Exception: No such file or directory
at System.Diagnostics.Process.ResolvePath(String filename)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) …Run Code Online (Sandbox Code Playgroud) 我有一个角度js应用程序,我有一个选项,如当前位置.点击此选项,我们应该可以看到我们当前的位置,只是位置名称或该位置的谷歌地图.在这种情况下,任何正文都可以帮助使用自定义指令.该应用程序使用PhoneGap转换为Android.