Can I access the registry from the intranet?
I have a problem. I've written a small VB.net application that should be used by others on our company. So the application will be put on our local network.
One part of the application analyses parts of the registry to determine which MS Office version the current user has (the reason is that I want to do some standard modifications to each MS Office registry settings).
Now.. the problem is that this works fine as long as the application is stored on my hard drive. But when I put the application (the exe-file) on the local intranet I get security policy exceptions. I guess that my computer doesn't allow that external applications tries to read my registry(?).
So my question is if there's a way to write a registry reading program that works from the intranet?
Please let me know! Just give me a small source code example that should work...
The problem you are having is that .Net security on the local computer (the computer running the app) defaults different permissions to a .Net assembly located locally vs. one located on a network drive.
You can change this security
Follow these steps:
Control Panel>Admin tools>Microsoft .NET Framework 2.0 Configuration
From left tree, select Runtime Security Policy
From the right, click Increase Assembly Trust
Select "To this computer" or "This user" to allow this application for the
computer or user
Browse to the assembly
Set security to "Full trust"
You can also choose Adjust Zone Security to change security for a zone
Thanks for your reply, Darren
But are there other ways to get around this? I have no trouble to let a Windows Shell Script to modify the registry if it is executed from the intranet. Furthermore, an installation program that is executed from the intranet also (often) modifies the registry on my computer when it is installed. Doesn't it? Perhaps I should not use VB.NET??
I can't go around the entire company and modify the security settings manually on each computer *phew*!
Can you state what the error message is you are receiving when you run the VB.Net app from the intranet?
"An exception "System.Security.Policy.PolicyException" has occurred in [TheAppName.exe]
Additional Information: Required permissions cannot be acquired"
But I wonder if this can be solved without changing the permissions on every computer that should run this program? Does it help to use another compiler (and probably rewrite the code slightly)?
On one machine, try to elevate the Intranet Zone security to full trust using the .Net Config tool. Run your app from the Intranet location.
If it works, you know that this is the problem.
I know that you can set the .Net Security parameters globally on your network/domain instead of using the tool on each machine. That is a question for a system admin.
By RossOliver in forum VB Classic
Last Post: 03-16-2006, 06:23 PM
By SINNI in forum VB Classic
Last Post: 03-21-2001, 09:00 AM
Last Post: 11-24-2000, 08:17 AM
By Marie in forum VB Classic
Last Post: 11-20-2000, 06:32 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center