一个只使用应用程序 [英] One use only application

查看:83
本文介绍了一个只使用应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!我有一个应用程序,我只需要在任何给定的计算机上运行一次。之后它应该变得无用。你有什么想法?



P.S.我想让它成为一个离线应用程序,所以我不能考虑建立一个数据库。

Hello! I have an application which I need to run on any given computer only once. After that it should be rendered useless. What ideas do you have?

P.S. I want to make it an offline app so I can't take into consideration making a database.

推荐答案

你几乎只限于在注册表中添加一个条目或创建隐藏文件。这两种方法的问题在于它们可以被规避 - 遗憾的是,没有其他真正的方法可以做到这一点(好吧,如果应用程序没有被卸载并重新安装)。



如果可以在以后卸载并重新安装应用程序并再次运行,那么您可以随时修改附属程序集的PE部分 - 这在很大程度上是万无一失的,超出了大多数临时用户的技能,无法篡改。
You are pretty much limited to either adding an entry into the registry or creating a hidden file. The problem with both of these approaches is that they can be circumvented - unfortunately, there's no other real way of doing this (well, there is if the application isn't uninstalled and reinstalled).

If the application can be uninstalled and reinstalled at a later stage, and run again, then you could always modify the PE portion of a satellite assembly - that's largely foolproof and beyond the skill of most casual users to tamper with.


问候。



当您运行应用程序时,在您的系统中创建了一些注册表项。每次运行应用程序时,请检查该条目是否存在于注册表中。如果条目存在,退出应用程序,否则继续。





问候



Dominic Abraham
Greetings.

When you are running your application, made some registry entries in your system. Each time when you run your application, check whether the entry exists in registry. If entry exists exit the applcation else continue.


Regards

Dominic Abraham


在Program.cs中粘贴以下代码: -



Paste following code in your Program.cs:-

#region  ******** Check app already open *********
           if (System.Diagnostics.Process.GetProcessesByName("ExeName").Length > 1)
           {
               Application.Exit();
               Environment.Exit(1);
               return;
           }
           #endregion


这篇关于一个只使用应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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