C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






How to save configuration settings of the assembly into the registry?


Posted Date: 18 Jun 2008    Resource Type: Articles    Category: .NET Framework

Posted By: Sneha Singla       Member Level: Silver
Rating:     Points: 10



Steps are :

Open AssemblyInfo.cs of the solution and remove all asterisks from the AssemblyVersion:

( For eg :[assembly: AssemblyVersion("1.0.*")] - Remove the asterisks )
[assembly: AssemblyVersion("1.0.0.0")]

Otherwise, every time you build your application the registry key will change.

Save configuration values to the registry as follows:

Application.UserAppDataRegistry.SetValue("Value", Value);

Load configuration values to the registry as follows:

try
{
Value = (int) Application.UserAppDataRegistry.GetValue("Value");
}
catch(Exception)
{
}

The GetValue method will throw an exception if the specified value does not exist in the registry.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Handling Application Level Exceptions in Windows and Web Applications
Previous Resource: Difference between using directive and Using Statement in .NET
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use