<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FWindows%2FRegistry_Save</id>
		<title>Csharp/CSharp Tutorial/Windows/Registry Save - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FWindows%2FRegistry_Save"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Windows/Registry_Save&amp;action=history"/>
		<updated>2026-04-29T17:46:33Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Windows/Registry_Save&amp;diff=6692&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Windows/Registry_Save&amp;diff=6692&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Windows/Registry_Save&amp;diff=6693&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Windows/Registry_Save&amp;diff=6693&amp;oldid=prev"/>
				<updated>2010-05-26T12:20:15Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==delete a key from Registry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
&lt;br /&gt;
public class MainClass{&lt;br /&gt;
    static void Main(string[] args){&lt;br /&gt;
         string strKey;&lt;br /&gt;
         string strAns;&lt;br /&gt;
         Console.WriteLine(&amp;quot;Enter the key under HKEY_CURRENT_USER to delete&amp;quot;);&lt;br /&gt;
         strKey = Console.ReadLine();&lt;br /&gt;
         Console.WriteLine(&amp;quot;Do you really mean to delete: &amp;quot; + strKey + &amp;quot; and its settings?&amp;quot;);&lt;br /&gt;
         strAns = Console.ReadLine();&lt;br /&gt;
         strAns = strAns.ToUpper();&lt;br /&gt;
         if (strAns == &amp;quot;YES&amp;quot; | strAns == &amp;quot;Y&amp;quot;)&lt;br /&gt;
         {&lt;br /&gt;
               Registry.CurrentUser.DeleteSubKeyTree(strKey);&lt;br /&gt;
               Console.WriteLine(&amp;quot;Key &amp;quot; + strKey + &amp;quot; deleted&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
               Console.WriteLine(&amp;quot;No deletion performed&amp;quot;);&lt;br /&gt;
         }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Delete a setting in Registry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
&lt;br /&gt;
public class MainClass{&lt;br /&gt;
    static void Main(string[] args){&lt;br /&gt;
        string strKey;&lt;br /&gt;
        string strSetting;&lt;br /&gt;
        string strAns;&lt;br /&gt;
        Console.WriteLine(&amp;quot;Enter the key&amp;quot;);&lt;br /&gt;
        strKey = Console.ReadLine();&lt;br /&gt;
        RegistryKey TestProject = Registry.CurrentUser.OpenSubKey(strKey, true);&lt;br /&gt;
        Console.WriteLine(&amp;quot;Enter the setting&amp;quot;);&lt;br /&gt;
        strSetting = Console.ReadLine();&lt;br /&gt;
        Console.WriteLine(&amp;quot;Do you really mean to delete: &amp;quot; + strKey + &amp;quot;\\&amp;quot; + strSetting + &amp;quot;?&amp;quot;);&lt;br /&gt;
        strAns = Console.ReadLine();&lt;br /&gt;
        strAns = strAns.ToUpper();&lt;br /&gt;
        if (strAns == &amp;quot;Y&amp;quot; | strAns == &amp;quot;YES&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
             TestProject.DeleteValue(strSetting);&lt;br /&gt;
             Console.WriteLine(&amp;quot;Key setting &amp;quot; + strKey + &amp;quot;\\&amp;quot; + strSetting + &amp;quot; deleted&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
             Console.WriteLine(&amp;quot;No deletion performed; key closed&amp;quot;);&lt;br /&gt;
             TestProject.Close();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save int value to Registry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(String[] args)&lt;br /&gt;
    {&lt;br /&gt;
        Registry.SetValue(&lt;br /&gt;
            @&amp;quot;HKEY_CURRENT_USER\Software\CompanyName\SoftwareName&amp;quot;,&lt;br /&gt;
            &amp;quot;IntValueName&amp;quot;, 101, RegistryValueKind.DWord);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save user prefs to registry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
using System.Diagnostics;&lt;br /&gt;
public class MainClass{&lt;br /&gt;
   public static void Main(){&lt;br /&gt;
    RegistryKey regKey = Registry.CurrentUser;&lt;br /&gt;
    regKey = regKey.CreateSubKey(&amp;quot;Software\\YourSoftwareName\\SubDomain&amp;quot;);&lt;br /&gt;
    regKey.SetValue(&amp;quot;CurrSize&amp;quot;, 10);&lt;br /&gt;
    regKey.SetValue(&amp;quot;CurrColor&amp;quot;, &amp;quot;Blue&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set DateTime value to the Registry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(String[] args)&lt;br /&gt;
    {&lt;br /&gt;
        Registry.SetValue(&lt;br /&gt;
            @&amp;quot;HKEY_CURRENT_USER\Software\CompanyName\SoftwareName&amp;quot;,&lt;br /&gt;
            &amp;quot;DateTimeValue&amp;quot;, DateTime.Now.ToString(), RegistryValueKind.String);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set String value to the Registry==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using Microsoft.Win32;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(String[] args)&lt;br /&gt;
    {&lt;br /&gt;
        Registry.SetValue(&lt;br /&gt;
            @&amp;quot;HKEY_CURRENT_USER\Software\CompanyName\SoftwareName&amp;quot;,&lt;br /&gt;
            &amp;quot;User&amp;quot;, Environment.UserName, RegistryValueKind.String);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>