[英]My C# win form application internally calls a batch script how do I hide it from the end user while exporting in Visual Studio?
Inside my C# project, there is a folder called "scripts" that has my batch scripts inside it however while exporting the project I don't want the end-user to tamper with those scripts or make modifications.在我的 C# 项目中,有一个名为“scripts”的文件夹,里面有我的批处理脚本,但是在导出项目时,我不希望最终用户篡改这些脚本或进行修改。 I would really appreciate it, if there was a way to hide these scripts from the user completely.
如果有办法对用户完全隐藏这些脚本,我将不胜感激。 OR Any other way that could possibly mask their existence completely.
或任何其他可能完全掩盖其存在的方式。
Embed the Batch files as resources.将批处理文件嵌入为资源。 Save it to a temporary file, run it and delete the temporary file after it ran.
将它保存到一个临时文件中,运行它并在运行后删除临时文件。
Depending on the content of the batch file, it might be possible to run the programs called by the batch file in C# directly.根据批处理文件的内容,可以直接在 C# 中运行批处理文件调用的程序。
There are also tools like Bat2Exe which convert the batch file into an executable, hiding that it once was a BAT file.还有像Bat2Exe这样的工具将批处理文件转换为可执行文件,隐藏它曾经是一个 BAT 文件。 Make sure to check the license conditions.
请务必检查许可条件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.