473,386 Members | 1,630 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,386 software developers and data experts.

RegistryKey function

R A
Hi

I write the registry value using the following:
Size size = new Size (100, 500);

Key.SetValue (ClientSizeName, size);

How can I retreive the value back to a Size type?

When I use

System.Type t = Key.GetValue (ClientSizeName).GetType ();

It comes back as a string, and thats ok because thats how it gets stored in
the registry. I wonder if there is a way to get it back as a Size type, or
do I have to manipulate the string?

Thanks,

Ronen


Nov 15 '05 #1
1 1892
R A,

Could you not just cast the result like this:

Size s = (Size) Key.GetValue (ClientSizeName);
--
John Wiese
---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"R A" <ro****@hotmail.com> wrote in message
news:Oe**************@TK2MSFTNGP10.phx.gbl...
Hi

I write the registry value using the following:
Size size = new Size (100, 500);

Key.SetValue (ClientSizeName, size);

How can I retreive the value back to a Size type?

When I use

System.Type t = Key.GetValue (ClientSizeName).GetType ();

It comes back as a string, and thats ok because thats how it gets stored in the registry. I wonder if there is a way to get it back as a Size type, or
do I have to manipulate the string?

Thanks,

Ronen

Nov 15 '05 #2

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

Similar topics

0
by: geek_in_a_box | last post by:
I seem to be experiencing a behavior on Framework 1.0 sp2 RegistryKey class where the class is not releasing/closing named pipe winreg handles to remote machines. The process continues to hold on...
1
by: R Agam | last post by:
Hi How can I tell what type of value (string, int, ...) is returned from a call to RegistryKey.GetValue? Thanks, Ronen
7
by: Bob | last post by:
I'm working on a Windows app that needs to write to the Registry HKLM. I keep getting a "System.UnauthorizedAccessException: Cannot write to the registry key." error when running the app. I'm...
0
by: csharp_helpwanted | last post by:
steps.. first, I'm creating a connection by mapping a network drive to the pc second, the map drive connection was successful I try to read a certian registry key/value (that is a valid reg...
0
by: g82martin | last post by:
I am using the RegistryKey class to access the registry on remote machines. I only require read access. I am able to successfully read registry keys under HKLM\Software\Microsoft\Windows...
1
by: Brian Keating | last post by:
Hi there anyone know to the get the native registry Handle from a RegistryKey? thanks in advance
5
by: Steve Bottoms | last post by:
Hi, all... Trying to determine how to check the state of OpenSubKey when called. What is the return value if the requested subkey doesn't exist?? I try a GetType on the result but only get a...
2
by: auldh | last post by:
being a novice i searched the net to get help on my c# project. i'm trying to iterate, enumerate, loop through a registry tree hive. for example i have a sub folder under HKLM\SOFTWARE that has...
4
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. Here is my problem. I have a program that will create a registry key, however it is not and here is the code and also the error that follows: ...
3
by: marcussilfver | last post by:
How can I set write permissions for a limited user to write values to a certain registrykey. This registrykey is also written to by a administrator (which probably also created the key in the first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.