使用 C# 项目打包 LAME.exe

发布于 2024-09-02 17:30:33 字数 467 浏览 6 评论 0原文

请原谅我在这方面的菜鸟性,但是如何将 LAME.exe 打包到 C# 安装项目中?目前,我对 LAME 的调用如下:

//use stringbuilder to create arguments    
var psinfo = new ProcessStartInfo( @"lame.exe")
    {
         Arguments = sb.ToString(),
         WorkingDirectory = Application.StartupPath,
         WindowStyle = ProcessWindowStyle.Hidden 
    };
var p = Process.Start( psinfo );
p.WaitForExit();

这在开发计算机上的调试和发布模式下工作,但是当我为此创建安装项目时,它永远不会创建 MP3。安装时,LAME 和编译后的代码位于同一目录中。帮助!

Please forgive my noob-ness on this, but how do I package LAME.exe w/ a C# setup project? Currently, I have LAME being called like:

//use stringbuilder to create arguments    
var psinfo = new ProcessStartInfo( @"lame.exe")
    {
         Arguments = sb.ToString(),
         WorkingDirectory = Application.StartupPath,
         WindowStyle = ProcessWindowStyle.Hidden 
    };
var p = Process.Start( psinfo );
p.WaitForExit();

This works in debug and release modes on the development machine, but when I create a setup project for this, it never creates the MP3. LAME and the compiled code reside in the same directory when installed. Help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贪了杯 2024-09-09 17:30:34

窗口样式=
ProcessWindowStyle.Hidden

将其注释掉,以便您可以实际阅读 lame 产生的错误消息。使用单独的 EXE 很脆弱,您无法检测或诊断它是否无法完成其工作。您可能会从 Process.ExitCode 中看到一些内容,非零值应该表示失败。

WindowStyle =
ProcessWindowStyle.Hidden

Comment this out so you can actually read the error message that lame produces. Using a separate EXE is brittle this way, you cannot detect nor diagnose it failing to do its job. You might see something from Process.ExitCode, non-zero values are supposed to indicate failure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文