473,320 Members | 2,024 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,320 software developers and data experts.

SaveSetting/GetSetting Replacement

As an old vb6 programmer coming to C# I was wanting to update my technique
for storing app settings like for form controls state(radioButton, checkBox
selection) and user configurable settings. In vb6 I did this by using the
SaveSetting/GetSetting pairs to store & retrieve the key value pairs
into/from the registry.

What's a better or another way to do this with C#?

Thanks
Mike

May 24 '06 #1
2 12989
C# doesn't have "built-in" functions the way VB does, so there isn't
really an equivalent.

If you want to read and write to the Registry, you use the
Microosft.Win32.RegistryKey class.

Or, if you really like the VB functions, you can reference
Microsoft.VisualBasic.dll and call them.

In addition there is an article on this very subject:

http://msdn.microsoft.com/library/de...albasicnet.asp

--
-Demetri
"Mike in Santa Rosa" wrote:
As an old vb6 programmer coming to C# I was wanting to update my technique
for storing app settings like for form controls state(radioButton, checkBox
selection) and user configurable settings. In vb6 I did this by using the
SaveSetting/GetSetting pairs to store & retrieve the key value pairs
into/from the registry.

What's a better or another way to do this with C#?

Thanks
Mike

May 24 '06 #2
What about writing to an xml file like the old .ini files?

I don't necessarily need to put this into the registry.

mike
"Demetri" <De*****@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
C# doesn't have "built-in" functions the way VB does, so there isn't
really an equivalent.

If you want to read and write to the Registry, you use the
Microosft.Win32.RegistryKey class.

Or, if you really like the VB functions, you can reference
Microsoft.VisualBasic.dll and call them.

In addition there is an article on this very subject:

http://msdn.microsoft.com/library/de...albasicnet.asp

--
-Demetri
"Mike in Santa Rosa" wrote:
As an old vb6 programmer coming to C# I was wanting to update my
technique
for storing app settings like for form controls state(radioButton,
checkBox
selection) and user configurable settings. In vb6 I did this by using the
SaveSetting/GetSetting pairs to store & retrieve the key value pairs
into/from the registry.

What's a better or another way to do this with C#?

Thanks
Mike

May 24 '06 #3

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

Similar topics

5
by: Paul Miller | last post by:
We've run into minidom's inabilty to handle large (20+MB) XML files, and need a replacement that can handle it. Unfortunately, we're pretty dependent on a DOM, so a pulldom or SAX replacement is...
53
by: Kerberos | last post by:
I followed Dan Cederholm's image replacement tutorial, to replace a header tag by a logo. The h1 is clickable if no CSS is applied but it I replace it by the logo, the area isn't clickable anymore...
3
by: Vibha Tripathi | last post by:
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject)...
1
by: Roundy | last post by:
We have an application that communicates with a PLC in the field. All of the values from the PLC are written to registry keys under hkey_current_user\software\vb and vba programming\application...
20
by: Paul D. Boyle | last post by:
Hi all, There was a recent thread in this group which talked about the shortcomings of fgets(). I decided to try my hand at writing a replacement for fgets() using fgetc() and realloc() to read...
2
by: Mike | last post by:
VB .NET version 2003 What is the equivalent of GetSetting when trying to read a .INI file. I'm trying to read a .INI file and can't find anything that will help.
0
by: Brad Dennis | last post by:
Using Access 2003, I have a form that reads registry settings using the GetSetting function. It works fine as long as I haven't signed the VBA code. But after using my Thawte Code Signing...
1
by: lawrence k | last post by:
Want to replace the limit clause in a query, but can't get it right. What's wrong with this: $pattern = "(.*)limit (.*)"; $replacement = '$1'; $replacement .= "LIMIT $limit"; $replacement .=...
3
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
I've added a web deployment project and want to use the config section replacement but I'm obviously not understanding something. I have set up an alternate appSettings file,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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

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.