<?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%2FData_Structure%2FDictionary</id>
		<title>Csharp/CSharp Tutorial/Data Structure/Dictionary - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FData_Structure%2FDictionary"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Dictionary&amp;action=history"/>
		<updated>2026-04-30T07:47:22Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Dictionary&amp;diff=5561&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/Data_Structure/Dictionary&amp;diff=5561&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/Data_Structure/Dictionary&amp;diff=5562&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Dictionary&amp;diff=5562&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:55Z</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;==Add to dictionary==&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;
    public class Tester&lt;br /&gt;
    {&lt;br /&gt;
        static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            Dictionary&amp;lt;string, string&amp;gt; Dictionary = new Dictionary&amp;lt;string, string&amp;gt;();&lt;br /&gt;
            Dictionary.Add(&amp;quot;1&amp;quot;, &amp;quot;J&amp;quot;);&lt;br /&gt;
            Dictionary.Add(&amp;quot;2&amp;quot;, &amp;quot;S&amp;quot;);&lt;br /&gt;
            Dictionary.Add(&amp;quot;3&amp;quot;, &amp;quot;D&amp;quot;);&lt;br /&gt;
            Dictionary.Add(&amp;quot;4&amp;quot;, &amp;quot;A&amp;quot;);&lt;br /&gt;
            Console.WriteLine(Dictionary[&amp;quot;1&amp;quot;]);&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dictionary Demo==&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.ruponentModel;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
    class DictionaryDemo&lt;br /&gt;
    {&lt;br /&gt;
        static Dictionary&amp;lt;string,int&amp;gt; CountWords(string text)&lt;br /&gt;
        {&lt;br /&gt;
            Dictionary&amp;lt;string,int&amp;gt; frequencies = new Dictionary&amp;lt;string,int&amp;gt;();&lt;br /&gt;
                &lt;br /&gt;
            string[] words = Regex.Split(text, @&amp;quot;\W+&amp;quot;);&lt;br /&gt;
                &lt;br /&gt;
            foreach (string word in words)&lt;br /&gt;
            {&lt;br /&gt;
                if (frequencies.ContainsKey(word))&lt;br /&gt;
                {&lt;br /&gt;
                    frequencies[word]++;&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    frequencies[word] = 1;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            return frequencies;&lt;br /&gt;
        }&lt;br /&gt;
        static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            string text = &amp;quot;this is a test&amp;quot;;&lt;br /&gt;
            Dictionary&amp;lt;string, int&amp;gt; frequencies = CountWords(text);&lt;br /&gt;
            foreach (KeyValuePair&amp;lt;string, int&amp;gt; entry in frequencies)&lt;br /&gt;
            {&lt;br /&gt;
                string word = entry.Key;&lt;br /&gt;
                int frequency = entry.Value;&lt;br /&gt;
                Console.WriteLine(&amp;quot;{0}: {1}&amp;quot;, word, frequency);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use the keys to obtain the values from a generic Dictionary&amp;lt;TK, TV&amp;gt;==&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;
  &lt;br /&gt;
class MainClass {  &lt;br /&gt;
  public static void Main() {  &lt;br /&gt;
    Dictionary&amp;lt;string, double&amp;gt; dict = new Dictionary&amp;lt;string, double&amp;gt;();  &lt;br /&gt;
      &lt;br /&gt;
    // Add elements to the collection. &lt;br /&gt;
    dict.Add(&amp;quot;A&amp;quot;, 7);  &lt;br /&gt;
    dict.Add(&amp;quot;B&amp;quot;, 5);  &lt;br /&gt;
    dict.Add(&amp;quot;C&amp;quot;, 4);  &lt;br /&gt;
    dict.Add(&amp;quot;D&amp;quot;, 9);  &lt;br /&gt;
  &lt;br /&gt;
    // Get a collection of the keys (names). &lt;br /&gt;
    ICollection&amp;lt;string&amp;gt; c = dict.Keys;  &lt;br /&gt;
  &lt;br /&gt;
    foreach(string str in c)  &lt;br /&gt;
      Console.WriteLine(&amp;quot;{0}, Salary: {1:C}&amp;quot;, str, dict[str]);  &lt;br /&gt;
  }  &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;A, Salary: $7.00&lt;br /&gt;
B, Salary: $5.00&lt;br /&gt;
C, Salary: $4.00&lt;br /&gt;
D, Salary: $9.00&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>