如何在编译后为变量赋值(无外部文件或DB) [英] How Can I Assign value to variable after compiling (without external file or DB)

查看:112
本文介绍了如何在编译后为变量赋值(无外部文件或DB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想在编译后为变量赋值。

例如,我想保存计算机信息和开始日期.......



它将此信息保存到.exe文件中,如果用户将此文件复制到另一台计算机,程序将自动将此信息与当前计算机信息进行比较(并禁用运行)。



有可能吗?如何在不使用数据库,文件或注册表的情况下将此数据保存在.exe文件中?



我正在使用C#



感谢您的阅读。

Hi ,
I wanna assign value to variable after compiling .
As example I wanna save computer information and date of starting and ... .

It saves this information into the .exe file and if user copy this file to another computer , Program will be automatically compare this information and current computer information (And disable to run).

Is it possible ? How can I save this data in .exe file without using database , or file or registry ?!

I am using C#

Thank u for read .

推荐答案

我不知道有什么方法可以将它保存到.Exe文件中,因为这会包括你重新编译它。通常做的是你有一个许可文件,你加密你需要存储的数据。然后,如果许可证文件不存在,您可以禁用该应用程序。或者,如果许可证文件中的某些信息无效,您可以禁用该应用程序。
I don't know of any way to save it into the .Exe file because that would include you recompiling it. What is often done is you have a license file where you encrypt the data you need to store. Then if the license file is not there you can disable the app. Or, if some of the information in the license file is not valid you can disable the app.


这篇关于如何在编译后为变量赋值(无外部文件或DB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆