0
CSharpCodeProvider codeProvider = new CSharpCodeProvider();
ICodeCompiler icc = codeProvider.CreateCompiler();
CompilerParameters parameters = new CompilerParameters();
string[] references = { "System.dll", "System.Windows.Forms.dll", "System.Drawing.dll", "System.Security.dll", "System.Core.dll" };

parameters.CompilerOptions = @"/win32icon:icon.ico";
parameters.ReferencedAssemblies.AddRange(references);
parameters.GenerateExecutable = true;
parameters.OutputAssembly = Output; //Output = Filename with extension
string readCode = File.ReadAllText(@"sourceCode.txt");
string replaceInput = readCode.Replace("placeholder", 
encryptedText);
CompilerResults results = icc.CompileAssemblyFromSource(parameters,replaceInput);

在 Windows 10 上这工作正常,但升级到 Windows 11 后,按钮和文本框等控件看起来不合适。有没有办法编译我的代码,以便它使用当前的 Windows 11 控件。我只是发现圆形按钮看起来非常好,我也希望能够使用它们。(它目前编译 Windows 10 控件顺便说一句) - 感谢所有回复

4

0 回答 0