Yes, I have thought about that ...
I indeed use the system.windows.forms.timer, and not as I have mentioned
mistakenly System.Timers.timer
(what is the best approach ?)
What I need to do is to create a token string, and for each 20 minutes I
need to re-create a token string.
There are two main functions :
1. Create the token-string.
2. Check if the token-string is a valid one.
There may be a problem when checking the token. This may be a minor problem,
but it may be, because there is a probability that I can check the token
while re-create a new token.
I have thought of such solutions (at first glance) :
1. First scenario, which holds the time (in ticks) in a variable.
A major function, which only by this function I can do (by sending it
parameters) : create the token string, or check the token, with interval of
one second. (It calculate and "knows" a specific time where it should be
re-create the token - only at 20 minutes interval and act as a dispatcher.
2. Do a thread. I don’t know if VB is good language for that, but thread is
something else different then using timers.
In both solutions, I need a protected memory, which cannot be changed
synchrony.
Another problem, which make things more complicated, I should think about :
the scenario of creating the token string, and the scenario of checking it
don't occur at the same main process (there are two different program).
I need also, a function, which cannot run asynchrony more then one process
(it may be a dll, but I don't know if dll may be asynchrony for two
process).
Thanks