Hi, I've a MySql database hosted in my web site, with a table named UsrLic
Where any one wants to buy my software must register and enter his/her Generated Machine Key (+ username, email ...etc).
So my question is:
I want to automate this process from my software, how this Process will be?
Should I connect and update my database directly from my software ( and this means I must save all my database connection parameters in it * my database username , password , server * and then use ADO or MyDac to connect to this database ? and if yes how secure is this process ?
You could go all kinds of different directions with it. You can wrap anything you would have normally done with a raw database connection in a web service call.
In your example, you would only have to include a (perhaps configurable) url that points at your "registration" service. The software can then attempt to hit that URL and provide the same critical information that you would have supplied via a raw query. Behind the scenes, the service hits the database and registers the information.
What happens next is up to you. Does the software store some kind of activation key locally once it's registered? Your service can return whatever information is needed to continue using the software assuming conditions are met. Does it check to make sure it's registered at each startup (requiring access to your service at all times)? If that's the case, you could pursue remote authentication where users must "log in" to your service(s) before being allowed to continue. Single sign on or SSO services provide some patterns/technology you could use to implement remote auth.