如何制作Matlab GUI的“试用版" [英] How can I make a 'trial version' of a matlab GUI
问题描述
我的目标是制作一个GUI,然后使用deploytool从中制作一个exe文件. 由于我不希望用户永远使用它,因此我想将其作为试用版,这意味着它只能在特定时间内使用.
My aim is to make a GUI, then by using deploytool to make an exe file from it. Since I don't want the user to be able to use it for ever I want to make it as a trial version meaning that it will work only for a certain time.
我想也许可以通过某种方式连接到用户的计算机时钟和日期,并使用代码作为时间限制,但是我发现这种逻辑存在一些问题.
I thought maybe by somehow connecting to the user's computer clock and date, and using the code for a time limit, but I found some problems it this logic.
任何想法,如何实现?
推荐答案
使用计算机时钟似乎是一种合理的方法.当然,用户不希望通过更改时钟来阻止它,但这很可能会带来足够的不便,他们宁愿支付合理的软件价格.
Using the computer's clock seems a reasonable way to go. Sure, the user than thwart that by changing the clock, but this will most likely create sufficient inconvenience that they rather pay the reasonable price of the software.
只需将以下内容放入GUI的OpeningFcn
Simply put the following inside the OpeningFcn
of your GUI
expiryDate = '2012-12-31';
if now > datenum(expiryDate)
h = errordlg('please upgrade to a full license');
uiwait(h)
return %# or throw an error
end
这篇关于如何制作Matlab GUI的“试用版"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!