Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save within app after deployment

Status
Not open for further replies.

Gimly

Programmer
Jan 5, 2003
26
ZA
Hi all,

Ok, when my programme is purchased, the owner has to email me and send me some info, I generate a Serial number for him/her to enter to make the programme run.

My question: How can I save the SN he/she enters without saving it in a DB?
Can I save it in a txt file so that everytime he runs the programme he does not have to enter the SN, the programme checks it automatically?

I also want the programmes' features (ie. buttons and all that) to be disabled until he enters a valid SN. How do I do this?

Any help would be greatly appreciated.

Regards
Gimly
 
I think that you would want to save the SN in a registry key - assuming that the prog. is going to be installed on Win 95 or later machines. Search MSDN for "SaveSetting" and this should lead you to 4 VB functions that deal with registry entries: SaveSetting, DeleteSetting, GetSetting and GetAllSettings. As for disabling buttons, etc., you should be able to do this depending on whether or not there is a valid SN in the registry key.

Hope this helps. Good luck. I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thank you for your reply jebenson.

Is there any other way I may be able 2 do it, save as a text file or something, I'm not comfortable in writing to the registry, but if there is no other way, I guess I'll just have 2 do it that way.

Thanx again for ur help.

Regards
Gimly
 
If you want to save it in a text file, you would do this:

Open "C:\Path\to\file\filename.txt" for Output as #1
Print #1, &quot;<serial number>&quot;
Close #1

This will create a text file and write the serial number to that file. You need to be careful only to call the code to create/write the file when you need to save the SN, as the Open statement will overwrite whatever is already there. To check the SN you would just do this:

Dim SN as string

Open &quot;C:\Path\to\file\filename.txt&quot; for Input as #1
Line Input #1, SN
Close #1

This will read the SN from the text file to a variabled called SN.

Hopr this helps. Good luck. I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Thank you again,

You will not know how much I appreciate all your help. I will definately take all your info into consideration and I'm sure I will use it.

Regards
Gimly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top