Oppure

Loading
Questo topic e' stato chiuso dal moderatore.
20/12/09 19:27
jaco94++
Vorrei modificare il valore (Predefinito) di una chiave (per essere + precisi vi allego una foto).
utilizzando i classici comandi per modificare una stringa di registro me ne crea un altra identica lasciando invariata quella vera ... come posso fare?
aaa
21/12/09 8:01
Thejuster
devi usare il riferimento Win32


using Microsoft.Win32;

RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Applicazione" );

if ( key == null ) 
{
   //Se la chiave non esiste creala
    key = Registry.CurrentUser.CreateSubKey(@"Software\Applicazione" );
}


//Prendo il valore

if ( key.GetValue( "Test" ) != null ) 
{
  
    Location = new Point( (int)key.GetValue( "X" ), (int)key.GetValue( "Y" ) );
}




Ultima modifica effettuata da Thejuster 21/12/09 8:12
mire.forumfree.it/ - Mire Engine
C# UI Designer
22/12/09 8:46
Il Totem
P.S.: Il valore (Predefinito) si indica con la stringa vuota "".
aaa
15/01/10 22:13
jaco94++
Grazie 1000 ora funziona perfettamente :k::rotfl:
aaa