views:

118

answers:

5

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.

+4  A: 

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?

hallie
+2  A: 

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.

Franci Penov
What you ment by 'admin install'
Vibin Jith
By admin install I mean that to install a client-side browser plugin most of the time the user needs to login as administrator. Which is undesirable.
Franci Penov
A: 

It's bad way. Use cookies.

Falcon
+1  A: 

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

Aristos
Local Database means ? Can i store in a file (xml) in the client ?Then tell me how ? I need your help. I think you know the exact.
Vibin Jith
Local database, means on your server. The remote database is your client. You saved on your server, and you connect that data with the cookie you get from your client - From the moment that is on server you can save them ether with any database, ether on xml, ether using this db4o.com that is an fast database on file.
Aristos
A: 

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 ....

Duncan