代码之家  ›  专栏  ›  技术社区  ›  Thorin Oakenshield

Python到C#转换

  •  2
  • Thorin Oakenshield  · 技术社区  · 14 年前

    在python中,我正在创建 .an

    commandStr="dpan.exe -np -Lwork_%s.lib -Owork_%s.lib %s %s.an" %( option1, option2, Sourcefile, Destination file)
    os.system( commandStr )
    

    这将创建 .an公司

    现在我将这一行代码从Python转换为C# commandStr 在C中# 请帮我做这个。

    2 回复  |  直到 14 年前
        1
  •  4
  •   Darin Dimitrov    14 年前

    你可以用 Process.Start

    Process.Start(
        "dpan.exe", 
        string.Format(
            "-np -Lwork_{0}.lib -Owork_{1}.lib \"{2}\" \"{3}.an\"", 
            option1, option2, sourceFile, destinationFile
        )
    );
    
        2
  •  2
  •   Konrad Rudolph    14 年前

    相当于 os.system System.Diagnostics.Process.Start