473,503 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remote Registry (read)

I keep getting a security error when trying to access a remote registry
could someone please help or post code which will correct the error I am
getting on the following line

clsRemoteRegKey = clsRemoteRegKey.OpenSubKey(\\SOFTWARE\\Microsoft\\ Windows
NT\\CurrentVersion\\CSDVersion);

---------------------------------

public string RemoteRegistryLocalMachineValue(string sServer)

{

try

{

SecurityPermission sp = new SecurityPermission
(SecurityPermissionFlag.UnmanagedCode);

RegistryPermission rp = new RegistryPermission
(RegistryPermissionAccess.AllAccess,"HKEY_LOCAL_MA CHINE");
RegistryKey clsRemoteRegKey;

clsRemoteRegKey =
Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(Micr osoft.Win32.RegistryHive.L
ocalMachine,sServer);

clsRemoteRegKey = clsRemoteRegKey.OpenSubKey("\\SOFTWARE\\Microsoft\ \Windows
NT\\CurrentVersion\\CSDVersion");

string[] sRemoteName=clsRemoteRegKey.GetValueNames();

sValue = clsRemoteRegKey.ValueCount.ToString();

Console.WriteLine(sValue);
}

catch(Exception err)

{

sValue = "ERROR";

Console.WriteLine(err.ToString());

}

return sValue;

}

Nov 15 '05 #1
0 9421

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1262
by: Bruce | last post by:
I'm able to use RegistryKey.OpenRemoteBaseKey to read a value on a remote machine's registry, but I'm unable to write to the key using .SetValue, getting an unauthorized access exception. As I'm...
2
2804
by: Vinay | last post by:
Hi We can use Environment class to read %Temp% variable o local machine. But I want to read this variable for currently logged on used for remote machine. Is there anyway to do this using .NET? I...
3
3037
by: Slimo | last post by:
Hello, I'm searching some example of code (VB) for reading remote registry subkeys and keys. Thanks
3
4568
by: Geoff McElhanon | last post by:
I have been struggling with a security issue that occurs under .NET 2.0, but does not occur under .NET 1.1. Essentially I am trying to open up a performance counter on a remote server and monitor...
4
6752
by: Chuck B | last post by:
I am modifying remote registries for about 150 computers. Is there any easy way in C# to do a remote registry backup?
1
3664
by: Jason Richmeier | last post by:
I am attempting to set permissions on a set of registry keys on a remote computer. I am able to open the registry key on the remote computer and read values from it. However, when I call the...
0
1855
by: =?Utf-8?B?cGhpbC5k?= | last post by:
Hi, I've a need to use remote username and password credentials to access remote registry information via VB.net, can this be done? I've currently a vbs script that periodically accesses wmi...
5
6956
by: Sin Jeong-hun | last post by:
I need to read some registry keys of a remote computer. The key will be any key users provide. (For example : HKEY_CURRENT_USER\SOFTWARE \MyGame) I found that there was a handy method called...
3
8307
by: JB | last post by:
I am trying to access a registry key on computer like so: key = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, computerName).OpenSubKey(Subkey); There are two keys I am trying to...
12
5619
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i current have a way to read both local and remote machines registry keys and create a textual view (.txt output). i now looking for ways to do export of local and remote mahcine registry keys...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.