IsolatedStorageFile Question

J

Jason Ho

Dear All,

I would like to store the registration info of a user of my software. Every
time my program start, I will check form the IsolatedStorageFile whether the
software is registered. If not, the software can just work for 30 trial days
and become unusable.

However, I found that my program will read different IsolatedStorageFile
when the .exe program is placed in different folder. Therefore, when the
software is expired, the user can copy the .exe to another folder and a new
trial period starts.

Is it possible to let my program to read the same IsolatedStorageFile no
matter where the .exe is placed and who is logged in?

Below is the way I create and read my IsolatedStorageFile:

Dim isoStore As IsolatedStorageFile
isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.Assembly Or
IsolatedStorageScope.User, Nothing, Nothing)

'read the IsolatedStorageFile
Dim reader As StreamReader
reader = New StreamReader(New IsolatedStorageFileStream("reg_info.secret",
FileMode.Open, isoStore))

Do you have any hints for me on this?

Thanks,
Jason
 
C

Cor Ligthert

Jason,

Please do not multipost, why not crosspost sending one message to more
newsgroups in one.

Cor
 
W

William Stacey [MVP]

However, I found that my program will read different IsolatedStorageFile
when the .exe program is placed in different folder. Therefore, when the
software is expired, the user can copy the .exe to another folder and a new
trial period starts.

I have not heard of that behavior, but will check. I know if different user
and/or different assembly (i.e. version) will use different ISO store
depending on options you set for ISO store.

IMO, I would bother with ISO for storing this info. On the one hand, it is
convient because it is out of the way, on the other hand it is a pain as it
is out of the way. It is not a security barrier as you can easily get to
the store as a user. I would keep the license file with the exe (same dir).
I think this allows better support and is easier to diag stuff. Things like
"is the file there?", "what does it contain?, etc. These are easy when you
keep the file seperate in same dir in plain text (e.g. xml). If using ISO,
you need to come up with special programs or long doco to fix or debug
issues.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top