Quantcast
Channel: Gemalto Sentinel Customer Discussions
Viewing all articles
Browse latest Browse all 1619

What is the best way to check if a dongle is present?

$
0
0
Hello,

I am using the sentinel licensing API to protect some functionality in a C# program I am developping.

What I want to do:
I am checking every 2 seconds if a dongle is present, if so I read some Bytes in its memory and show it in my GUI, if not I show "Dongle not present".

My ideas:
1. I was initially using the function Hasp.GetInfo() to extract some Information, if a dongle is present I get my info and can try to log in with Hasp.Login(), if not I know there are no dongles and my functionality is locked. It was working ok but I got the problem that the function Hasp.GetInfo() doest not work for legacy product (HASP HL v. 1.x) so I had to find something else.
2. Simply using the Hasp.Login() function. It also works but I am afraid, that I will get some kind of overflow after a while... Does this function always create a new Session? If so I am creating a new session every 2 seconds as long as the program is running and a dongle is present, is this a problem? I let my program run in debug mode for 1 hour and could not notice any unusual memory usage.

What would you say is the best way for me to check if the dongle is present using API functions? Maybe without starting a new session every time?

Many thanks,

Pierre

Viewing all articles
Browse latest Browse all 1619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>