I want to be able to create a simple trail feature for my program. Normally i base i on how many times the user has opened my the program. This time i want to be be based on what day the user starts using it, and then add on the trail period?
A.) Writing the first start-time into a file/registry and checking it back against the computer time.
B.) Writing the first start-time into a file/registry and checking it back against a time server. But you'd have a problem if that one isn't reachable.
C.) Let the user register, give him a key which has an encoded/hidden 'End-Date' within it.
D.) Create a profile of the computer and register the program with an Online database, with checkback if it is still within the period.
Sorry that I can't give you exact code... but something along the lines of [this isnt visual basic, but just a outline for what you have to do]:
VB.NET:
Dim var1 = CheckRegistry.DayExpire
Dim var2 = My.Computer.Time.Day
Dim var3 = var2 - var1
This is very sketchy, as I have no idea what the commands to check the value of a registry or the current date of your computer are, but am almost certain they are there.
Basically, you'd have to do something along the lines of checking the month and including that in the Dim for var1 and var2.
Once you have var1 and var2 set correctly to VB.Net's standards, you just use var3 to get the amount of days left.
I am new to VB.Net, but not to coding in general. I am guessing you can make a textbox that is blank, and on the form load event sub... have it check how many days there are left and put that number in for whatever textbox you want.
I hope this helps you out a tad. If you don't get or can't find exact answers here, may I suggest googling some things you may be having trouble on, such as defining var1 and var2. Sorry if I was little to no help to you, I am trying. We all start out as newbies to the language, don't we?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.