Click here to Skip to main content
15,078,241 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have looked around this site but maybe i am not entering it correctly to the search. I am trying to create a 30 day trial period for a software application. I have some code right now, but it doesn't seem to work with the Windows 7 and Vista UAC because it has to write to the windows directory. I don't want the dat file in the applications path. I have tried
environment.currentdirectory but that's a bit like the app path.
Any ideas as to where I can allow a file to read and write to without administrative privileges? It's vb net and vb 6 with the UAC on that seems to be the issue.
The code I have worked fine on XP.

1 solution

Is there any particular reason you wish to use file to store the trial period?
Bearing in mind that if you do use this method, a complete uninstall and re-install would re-allow the trial period.

Perhaps a reg setting is a better alternative? Also, users as standard should have sufficient permissions to read the registry (may require a admin to install 1st off).

There is a pretty good example here for using the Registry.
Working with Windows Registry using VB.NET[^]

Hope this helps.
mindserve 1-Oct-10 17:37pm
The way I have it set now, it leaves a dat file in the system so the user can't roll back the clock and uninstalling and reinstalling won't change the dates in the dat file.
My only problem is that I don't want to save it into the applications path and the UAC seems to be preventing me from allowing it to read back from or write to anything other than the application path. Much too easy for a user just to delete that file if they see it in the folder. Anyone can also delete a registry key and roll it back. thought this was a better way.. used to work on XP, but with the UAC on it does not work. UAC off it does work.

Thanks anyway.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900