Solved

Get Registry Type with C#

Posted on 2009-05-07
4
697 Views
Last Modified: 2013-12-17
I need to retrieve the Registry Type (e.g. REG_SZ) with C#

Any idea how to get this data?
0
Comment
Question by:schubduese
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Anthony408
ID: 24331806
Hi schubduese,

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
0
 
LVL 5

Accepted Solution

by:
rendaduiyan earned 500 total points
ID: 24332681
RegistryValueKind rvk = rkRoot.OpenSubKey(yourkey).GetValueKind(yourkey).
get details with GetValueKind from msdn.
0
 

Author Comment

by:schubduese
ID: 24333800
rendaduiyan, I think you mean .GetValueKind(yourvaluename)

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;

    ...

    ...
 

}

Open in new window

0
 
LVL 5

Expert Comment

by:rendaduiyan
ID: 24333954
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.net Multiple Row Form Fields Data Entry 4 18
How to open a link from vb.net app 3 9
cs.Designer Issue(2) 2 21
XML & .net 5 19
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now