Tutorial :How to access the client registry using JavaScript?



Question:

Hai , How to set Key and Value in the client registry using javascript. I Just want to keep the user profiles in the registry. When a user visit the page from a particular system , automatically connect to the system preferred database.For that I want to keep the connection string in the windows registry.

Please tell with code snippets , i am new in javascript.


Solution:1

You can not do that - if some can do that, is very easy to load a web page, and "format" your registry. Of cource you can always create a browser client plugin, but users not let it run and get a lot of waring that even make them go from your page.

Try this aproche - place a cookie on your client, and connect that cookie with a table on your local database, and the setting of your client. Then every time you see that cookie just load the settings. If the cookie-data not used for some months, then delete it.

If the data is personal and private, you must also create a login for your users.

If your customers are controled by you - and you can force them to use google chrome, you can also use the google gears for gogole chrome http://gears.google.com/ that can store data on the browser.

Samples of Database stored on clients browser using javascript. http://code.google.com/apis/gears/sample.html


Solution:2

I don't think its possible due to security reasons. Javascript are downloaded on the client side and you don't want someones javascript code accessing your registry right?


Solution:3

No can do, unless you have a client-side browser plugin. Even then, you need two separate plugins - one for IE and one for the Netscape family browser. That would require admin install. And would work for Windows clients only; there's no registry on Mac, iPhone, Android and Unix/Linux.


Solution:4

It's bad way. Use cookies.


Solution:5

Really bad idea. You should keep the user's profile on the server. What if they are not using the same computer all the time, for example at an internet cafe?

Oh, and of course, it would be a huge security flaw if it were possible to do this. So that means there's probably a way with IE ....


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »