Que pensez vous de la nouvelle version de Code-Source.NET ?

Choix

Lire et écrire dans la base de registre en C#

Lire et écrire dans la base de registre en C#

Membre depuis

2 années 10 mois

Nous avons parfois besoin d'enregistrer desinformations au niveau de la base de registre.

Voici un exemple de code en C# qui écrit puis lit à partir de la base de registre.

using Microsoft.Win32;
using System;

namespace EcrireLireRegistre
{
    class Program
    {
        static void Main(string[] args)
       {
            RegistryKey EcritureRegistre = Registry.CurrentUser;
            // Créer une clé dans le registre
            EcritureRegistre = EcritureRegistre.CreateSubKey(@"Code-Source.NET");
            EcritureRegistre.SetValue("SiteName","Code-Source.NET");
            EcritureRegistre.SetValue("SiteURL", "http://www.code-source.net");
            EcritureRegistre.SetValue("Nombre",100);
            EcritureRegistre.Close();
            RegistryKey LectureRegistre = Registry.CurrentUser;
            // Ouvrir une clé de registre
            LectureRegistre = LectureRegistre.OpenSubKey(@"Code-Source.NET");
            Object valeurSiteName = LectureRegistre.GetValue("SiteName");
            Object valeurSiteURL = LectureRegistre.GetValue("SiteURL");
            Object valeurNombre = LectureRegistre.GetValue("Nombre");
            LectureRegistre.Close();
            if ((string)valeurSiteName == "Code-Source.NET")
                Console.WriteLine("SiteName : {0}\nSiteURL : {1}\nNombre : {2}", valeurSiteName, valeurSiteURL, valeurNombre);
            else Console.WriteLine("Erreur de lecture de registre");
        }
    }
}

 

 

Comments

Nom
kl
Prénom
Ellie

Membre depuis

1 année
Permalien

Academic organization has a assignment to teach technologies that are extensively used in the genuine world so that students have the skill and information that employers need. additional than 90 percent of the programs organization on our desktops, Finance assignment help, from operating scheme and e-mail clients to Web browsers and utterance processors, are on paper in C or its relative, C++ which has extension to C. the majority games and underlying robot control software are written in C or C++. With the information of C, students will not only be able to engage in recreation games and robots, other than also understand their fundamental working principles and potentially expand their own games and android.

Membre depuis

8 mois 1 semaine
Permalien

Reading and writing are two major aspects for everyone to be a literate person. In showing uk essays you will have the good chance to get the order very clearly so that you can grab.

Membre depuis

8 mois 1 semaine
Permalien

Reading and writing are two major aspects for everyone to be a literate person. In showing uk essays you will have the good chance to get the order very clearly so that you can grab.

Nom
Vern
Prénom
Soffy

Membre depuis

3 mois 4 semaines
Permalien

<a href="https://www.pestveda.com/">Pest control service</a>
<a href="https://www.surveillancekart.com/">CCTV camera</a>
<a href="https://www.avriq.com">avriq</a>
<a href="https://goo.gl/maps/RDgzkYAgHNJ2">avriq location</a>
<a href="https://www.pestveda.com/services/termite-control">Termite Control</a>
<a href="https://www.surveillancekart.com/cp-plus.php">cp plus</a>
<a href="https://www.avriq.com/services/pc-optimization">PC Optimization</a>
<a href="https://www.google.com/maps/dir//AVRiQ+-+Your+personal+Tech+anytime+%26+Anywhere,+3321+O+Ave+NW,+Cedar+Rapids,+IA+52405/@41.989019,-91.7178067,17z/data=!4m8!4m7!1m0!1m5!1m1!1s0x87e4f7e8378ee29f:0x774296b85b10c086!2m2!1d-91.715618!2d41.989019
">avriq map</a>
<a href="https://www.pestveda.com/pages/pest-control-services-gurgaon/">Pest control service gurgaon</a>
<a href="https://www.pestveda.com/pages/pest-control-services-delhi/">Pest control service delhi</a>
<a href="https://www.pestveda.com/pages/pest-control-services-noida/">Pest control service noida</a>
<a href="https://www.pestveda.com/pages/pest-control-services-gurugram/">Pest control service gurugram</a>
<a href="https://www.pestveda.com/pages/pest-control-services-east-delhi/">Pest control service east-delhi</a>
<a href="https://www.pestveda.com/pages/pest-control-services-north-delhi/">Pest control service north-delhi</a>