【问题标题】:Write code for execution time on C# Command Line Application在 C# 命令行应用程序上编写执行时间代码
【发布时间】:2009-11-14 19:46:02
【问题描述】:

我想让我的程序在加载时执行一堆命令,顺便说一句,这是在 C# 中,但它是一个控制台程序,我该怎么做?

【问题讨论】:

  • 你能说得更具体一点吗?听起来您正试图从程序中执行外部命令,是这样吗?
  • 您能否详细说明一下。 I want to have my program execute a bunch of commands 相当混乱。标题和标签也无济于事。

标签: c# console-application execution-time


【解决方案1】:

如果您尝试从 C# 控制台应用程序中执行外部应用程序,请参阅 ProcessStartInfoProcess 类。

例子:

Process.Start("IExplore.exe", "www.google.com");

// -- OR --
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Maximized;
startInfo.Arguments = "www.google.com";
Process.Start(startInfo);

【讨论】:

    猜你喜欢
    • 2011-03-29
    • 2015-03-27
    • 2021-01-11
    • 1970-01-01
    • 1970-01-01
    • 2011-08-21
    • 2019-02-13
    • 2012-02-22
    • 2014-10-08
    相关资源
    最近更新 更多