[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Get Registry Type with C#

Posted on 2009-05-07
4
Medium Priority
?
721 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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