gpt4 book ai didi

c# - Codedom编译器图标选项错误

转载 作者:行者123 更新时间:2023-11-30 17:10:48 24 4
gpt4 key购买 nike

我正在与 Codedom 合作,使用自定义图标编译单个 Exes。

这是我用来指定图标文件的代码:

string temp;
temp = string.Format("/target:winexe /win32icon:{0}", testico);
cp.CompilerOptions = temp;

testico 在这种情况下是一个字符串,指定图标所在的位置。

现在的问题是,上面的代码只有在文件路径中没有空格时才有效。

因此,为了允许带空格的文件路径,我将代码修改为:

string temp;
temp = string.Format("/target:winexe /win32icon:\"{0}\"", testico);
cp.CompilerOptions = temp;

不幸的是,这不起作用。

有什么想法吗?谢谢

最佳答案

尝试:

\"/win32icon:{0}\"

引号包围整个论点

关于c# - Codedom编译器图标选项错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11820279/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com