schubduese
asked on
Get Registry Type with C#
I need to retrieve the Registry Type (e.g. REG_SZ) with C#
Any idea how to get this data?
Any idea how to get this data?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
rendaduiyan, I think you mean .GetValueKind(yourvaluenam e)
With this, it works... it reports for example "String"
That means I have to change it like this:
With this, it works... it reports for example "String"
That means I have to change it like this:
private String mValType = String.Empty;
switch (rvk.ToString())
{
case "String":
mValType = "REG_SZ";
break;
...
...
}
the returned value is a enum,
RegistryValueKind:
String, REG_SZ
ExpandString, REG_EXPAND_SZ
Binary, REG_BINARY
DWord, REG_DWORD
MultiString, REG_MULTI_SZ
QWord, REG_QWORD
Unknown
It is easy for you to handle the enum.
RegistryValueKind:
String, REG_SZ
ExpandString, REG_EXPAND_SZ
Binary, REG_BINARY
DWord, REG_DWORD
MultiString, REG_MULTI_SZ
QWord, REG_QWORD
Unknown
It is easy for you to handle the enum.
I am not quite sure what you mean by Registry Type, but here are some useful C# Registry Links that might point you in the right direction.
C# Registry Basics:
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=264
Registry In's and Out's Using C#:
http://www.csharphelp.com/archives2/archive430.html
Read, write and delete from registry with C#"
http://www.codeproject.com/KB/system/modifyregistry.aspx
Sorry if this is not what you are looking for.
-Anthony