Vis*_*har 4 c# windows-applications
我正在实现一个桌面应用程序,我想在其中发送一个ALT+SPACE组合键,但我找不到任何方法来执行此操作.
我正在实现这个以自动处理以下任务:
谁能帮我这个..?
试试这个
System.Windows.Forms.SendKeys.Send("% ");
Run Code Online (Sandbox Code Playgroud)
编辑
使用SendKeys有点'hacky'.相反,我建议使用Process类,如下所示
public string GetTracert(string ip)
{
Process p = new Process();
p.StartInfo.FileName = "tracert";
p.StartInfo.Arguments = "123.123.123.123";
p.StartInfo.RedirectStandardOutput = true;
p.Start();
return p.StandardOutput.ReadToEnd();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7165 次 |
| 最近记录: |