Click here to Skip to main content
15,877,967 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear All,

Please help me to write and read Client Windows registry using ASP.Net with C#. Already i did the application,but it is writing and reading from Server windows registry only which application is hosted. Anyone please help me.

Best Regards,

Updated 21-Apr-17 19:58pm
Sergey Alexandrovich Kryukov 14-Oct-14 1:24am    
fuad.p 14-Oct-14 1:33am    
Its for creating node on the client PC
Sergey Alexandrovich Kryukov 14-Oct-14 2:12am    
What node? why?
fuad.p 14-Oct-14 2:48am    
Node means just a string value.Why because,my application want to restrict for limited users who are working in the same company,not for all users. So when accessing application first time i want to write a 'string value' to registry. After that we want to read that string value every login.

Web applications/sites don't have access to client systems (and, just by the way, very limited access to the system of the HTTP server hosts). Especially to the system registry. Think by yourself: if such access was possible, how could you trust your systems to the Web?

Share this answer
Maciej Los 14-Oct-14 1:53am    
Nothing to add ;)
Sergey Alexandrovich Kryukov 14-Oct-14 2:10am    
Thank you, Maciej.
fuad.p 14-Oct-14 1:57am    
Web application is accessing client printer. Why can't we access Client registry same way?
Sergey Alexandrovich Kryukov 14-Oct-14 2:10am    
Because. I tried to explain. As to the printer: printer operation cannot affect the system and, in a way, not a part of system. Consider it as a screen. Nothing wrong. Register is a very different thing. Anyway, not matter "why", you cannot access registry. Just forget it. (I don't even want to discuss such a dirty thing as ActiveX.)
Maciej Los 14-Oct-14 2:18am    
Agree. Many of ActiveX is very suspicious. I'm keeping one rule: not install ActiveX.

I don't think reading and writing to windows registry is allowed due to security reasons from a ASP.Net code.
To limit access to specific users better save data in server and read when authenticated. May be think of a cookie based approach.

Share this answer
RegistryKey objRk = Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("VCR");
           cs = objRk.GetValue("db").ToString();
Share this answer
[no name] 22-Apr-17 6:14am    
Now that you have thrown access denied exception on the web server, what does this have to do with the security breach question that was asked and answered THREE years ago?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900