特定次数后限制应用程序执行 [英] Restrict Application Execution after a specific count

查看:56
本文介绍了特定次数后限制应用程序执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个应用程序.我的要求是应用程序只能打开10次.如果它是第11次或更多次打开,则应显示一个消息框并退出.

我尝试将计数存储在注册表中,但仅在单台PC上尝试时才起作用.
我的要求是,如果该应用程序已在10台不同的PC中打开,则不应第11次打开.

我们可以在项目资源中存储和更新值吗?

请问有人可以帮我吗?
如何解决这个问题?

我需要将应用程序部署在未通过LAN未连接的不同客户端位置上

Hi All,

i have an application. My requirement is that application should open for only 10 times. if it is opened 11th time or greater it should display a message box and exit.

I tried storing the count in registry but it working when we tried in single PC only.
My requirement is If the application has opened in 10 different PCs, it should not open for the 11th time.

Can we store and update the values in project resources?

Please can any one help me?
How to solve this problem?

I need to deploy my application in different Client locations which are not connected through a LAN

推荐答案

好,首先,如果没有两台计算机都可以上网,您提出的要求是不可能的使用权.
第一种方法是在中央计算机上创建数据库,检查初始化计数并在程序每次运行时更新表.这是最简单,最方便的方法.
另一种方法是利用云的功能.创建一个Microsoft skydrive帐户.在此处创建一个文件,该文件存储程序已运行了多少次.在程序初始化时,使用skydrive .net api 链接下载该文件,对其进行更新并上传.不要忘记对文件内容进行加密以防止篡改.
如果您没有任何操作中央服务器或SkyDrive的方法,则可以使用Google文档.这是很长的路要走,没有任何优化的方法,但是现在我想到了.使用google docs api,在电子表格中存储应用程序已运行了多少次.
作为一种有趣的方式,创建一个Twitter帐户并鸣叫零.打开程序时,请阅读最终推文,然后使用twitter api转推更新.
顺便说一句,我还是坚持使用skydrive
ok, first of all what you asked is not possible without each computer having internet access.
first way is to create a database in a central computer, check the initialization count and update a table each time the program runs. this is the easiest and most convenient way.
another way is to put the power of cloud to use. create a microsoft skydrive account. create a file there that stores how many times the program had run. on initialization of your program, download that file using skydrive .net api link, update it, and upload it. do not forget to encrypt the file contents to prevent tampering with it.
if you do not have any means to operate a central server or skydrive, as an alternate way, you can use google docs. this is a long way and not optimized in any means, but its what comes to my mind now. using google docs api, store how many times the application had run in a spreadsheet.
as a funny way, create a twitter account and tweet zero. on opening the program, read the final tweet and retweet the update using twitter api.
I''d stick with skydrive though


.您还可以创建Windows服务应用程序并将其安装在其中一台计算机上.
Windows服务应用程序将侦听传入计数请求,并以当前执行计数对其进行答复.与Windows服务和其他Windows应用程序进行通信时,可以使用.NET Remoting或WCF.
by the way. you can also create a windows service application and installed it on one of the computers.
the windows service application will listen for incoming count request and answered it with the current execution count. in communication with the windows service and the other windows application, you can use .NET Remoting or the WCF.


当然,如果您将计数存储在本地计算机上,那么它将适用于单台PC. .但是,如果将其放在集中式存储(例如,所有应用程序都将在其中连接,检索和更新计数)的数据库上,我相信可以成功.
Of course it will work for single PC if you store the count on the local machine. But if you put it on a centralized storage, say, a database where all of the applications will connect, retrive, and update the count, I believe that will do the trick.


这篇关于特定次数后限制应用程序执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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