473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Registry ? How to call GetType method

WJ
How do I call the RegistryKey.GetType() method in c#. I got to the
ValueKeyname and its Data.

John
Nov 15 '05 #1
1 1969
WJ <JW***@Msn2.Com> wrote:
How do I call the RegistryKey.GetType() method in c#. I got to the
ValueKeyname and its Data.


RegistryKey.GetType() would only return typeof(RegistryKey),
effectively. When you've got the Data, look at the type of *that*:

if (data is string)
{
....
}

if (data is int)
{
....
}

if (data is byte[])
{
....
}

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2

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

Similar topics

9
by: Yan Vinogradov | last post by:
Hi, Turns out it's possible to spoof another type with Object.GetType method. If you do this: namespace N { class C { public new Type GetType() { return (String.Empty.GetType()); }
6
by: auldh | last post by:
so far i have been able to understand how to use C# to read the regisry but getting to read the MULTI_SZ and REG_SZ just doesn't make sense. my sample program outputs the data as "System.String"...
7
by: Byron | last post by:
I have several user controls that have a few methods in common, such LoadFromForm() which populates an object from controls on the form. I want to call that method from the form in which the...
3
by: Michael | last post by:
Hi all : in vb.net I know use the follow code can implement dynamic call Dim asm As = .LoadFrom(<FileName>) Dim ty As Type = asm.GetType(<Object Name and class name>) Dim obj As Object =...
9
by: Just Me | last post by:
Public Shared Function GetValue(ByVal keyName As String, ByVal valueName As String, Optional ByVal badKey As Object = "") As Object Dim UserKey As RegistryKey =...
2
by: Don | last post by:
Is it possible to call a shared method of a class when you have both the name of the class and the name of the method of that class that you want to invoke stored in strings? If so, can this be...
6
by: ewolfman | last post by:
Hi, Is there any way in which I can monitor / hook the Registry, and upon a call to a specific key from a specific application - swap the returned value? I was thinking of using this method...
10
by: schneider | last post by:
I'm looking for a way to programaticly call a method from a different object and associate the two objects at runtime. Example: Object A exist and is unknow, I want object B to be able to call a...
3
by: Rymfax | last post by:
Hello, I was hoping someone could help me with a problem I'm having. I've got a C# app that uses several DLL Imports from setupapi.dll and others (Thanks again for the Help on those Willy). One...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.