<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_by_API%2FSystem.Collections%2FCollection</id>
		<title>VB.Net by API/System.Collections/Collection - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_by_API%2FSystem.Collections%2FCollection"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Collections/Collection&amp;action=history"/>
		<updated>2026-04-06T01:02:29Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Collections/Collection&amp;diff=2563&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Collections/Collection&amp;diff=2563&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:16Z</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;Версия 16:40, 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://www.vbex.ru/index.php?title=VB.Net_by_API/System.Collections/Collection&amp;diff=2564&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_by_API/System.Collections/Collection&amp;diff=2564&amp;oldid=prev"/>
				<updated>2010-05-26T12:51:16Z</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;==Collection.Add==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    &lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
       Dim intCollection As New Collection(  )&lt;br /&gt;
       Dim empCollection As New Collection(  )&lt;br /&gt;
       Dim empCollection2 As New Collection(  )&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;populate the Collections&lt;br /&gt;
       Dim i As Integer&lt;br /&gt;
       For i = 0 To 4&lt;br /&gt;
           empCollection.Add(New Employee(i + 100))&lt;br /&gt;
           intCollection.Add((i * 5))&lt;br /&gt;
       Next i&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;add key/value pairs&lt;br /&gt;
       empCollection2.Add(New Employee(1989), &amp;quot;G W&amp;quot;)&lt;br /&gt;
       empCollection2.Add(New Employee(1997), &amp;quot;J A&amp;quot;)&lt;br /&gt;
       empCollection2.Add(New Employee(1901), &amp;quot;T J&amp;quot;)&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;print each member of the array&lt;br /&gt;
       For Each i In intCollection&lt;br /&gt;
           Console.Write(&amp;quot;{0} &amp;quot;, i.ToString(  ))&lt;br /&gt;
       Next i&lt;br /&gt;
  &lt;br /&gt;
       Console.WriteLine(  )&lt;br /&gt;
       Console.WriteLine(&amp;quot;Employee collection...&amp;quot;)&lt;br /&gt;
       Dim e As Employee&lt;br /&gt;
       For Each e In empCollection&lt;br /&gt;
           Console.Write(&amp;quot;{0} &amp;quot;, e.ToString(  ))&lt;br /&gt;
       Next e&lt;br /&gt;
  &lt;br /&gt;
       Console.WriteLine(  )&lt;br /&gt;
       Console.WriteLine(&amp;quot;Employee collection 2...&amp;quot;)&lt;br /&gt;
       For Each e In empCollection2&lt;br /&gt;
           Console.Write(&amp;quot;{0} &amp;quot;, e.ToString(  ))&lt;br /&gt;
       Next e&lt;br /&gt;
  &lt;br /&gt;
       Console.WriteLine(  )&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;retrieve an Employee by key&lt;br /&gt;
       Dim emp As Employee&lt;br /&gt;
       emp = empCollection2.Item(&amp;quot;J A&amp;quot;)&lt;br /&gt;
       Console.WriteLine( emp.ToString(  ))&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;note that indexing is 1-based (rather than zero based)&lt;br /&gt;
       emp = empCollection2.Item(1)&lt;br /&gt;
       Console.WriteLine(emp.ToString(  ))&lt;br /&gt;
   End Sub&lt;br /&gt;
End Class&lt;br /&gt;
     Public Class Employee&lt;br /&gt;
         Private myEmpID As Integer&lt;br /&gt;
         Public Sub New(ByVal empID As Integer)&lt;br /&gt;
             Me.myEmpID = empID&lt;br /&gt;
         End Sub &amp;quot;New&lt;br /&gt;
         Public Overrides Function ToString(  ) As String&lt;br /&gt;
             Return myEmpID.ToString(  )&lt;br /&gt;
         End Function &amp;quot;ToString&lt;br /&gt;
         Public Property EmpID(  ) As Integer&lt;br /&gt;
             Get&lt;br /&gt;
                 Return myEmpID&lt;br /&gt;
             End Get&lt;br /&gt;
             Set(ByVal Value As Integer)&lt;br /&gt;
                 myEmpID = Value&lt;br /&gt;
             End Set&lt;br /&gt;
         End Property&lt;br /&gt;
     End Class &amp;quot;Employee&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Collection.GetEnumerator()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    &lt;br /&gt;
    Shared Sub Main(ByVal args As String())&lt;br /&gt;
        Dim m_employees As New Collection&lt;br /&gt;
        m_employees.Add(New employee(&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;Author&amp;quot;))&lt;br /&gt;
        m_employees.Add(New employee(&amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;Band&amp;quot;))&lt;br /&gt;
        m_employees.Add(New employee(&amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;, &amp;quot;Artist&amp;quot;))&lt;br /&gt;
        &amp;quot; Iterator.&lt;br /&gt;
        Dim emp As employee&lt;br /&gt;
        Dim employee_enumerator As IEnumerator&lt;br /&gt;
        employee_enumerator = m_employees.GetEnumerator()&lt;br /&gt;
        Do While (employee_enumerator.MoveNext)&lt;br /&gt;
            emp = CType(employee_enumerator.Current, Employee)&lt;br /&gt;
            Console.WriteLine(emp.Title &amp;amp; &amp;quot; &amp;quot; &amp;amp; emp.FirstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; emp.LastName)&lt;br /&gt;
        Loop&lt;br /&gt;
&lt;br /&gt;
        &amp;quot; For Each.&lt;br /&gt;
        For Each emp1 As employee In m_employees&lt;br /&gt;
            Console.WriteLine(emp1.Title &amp;amp; &amp;quot; &amp;quot; &amp;amp; emp1.FirstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; emp1.LastName)&lt;br /&gt;
        Next emp1&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
    Public Class Employee&lt;br /&gt;
        Public FirstName As String&lt;br /&gt;
        Public LastName As String&lt;br /&gt;
        Public Title As String&lt;br /&gt;
        Public Sub New(ByVal first_name As String, ByVal last_name As String, ByVal new_title As String)&lt;br /&gt;
            FirstName = first_name&lt;br /&gt;
            LastName = last_name&lt;br /&gt;
            Title = new_title&lt;br /&gt;
        End Sub&lt;br /&gt;
    End Class&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Collection.Item==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Collections&lt;br /&gt;
Public Class MainClass&lt;br /&gt;
    &lt;br /&gt;
    Shared Sub Main()&lt;br /&gt;
       Dim intCollection As New Collection(  )&lt;br /&gt;
       Dim empCollection As New Collection(  )&lt;br /&gt;
       Dim empCollection2 As New Collection(  )&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;populate the Collections&lt;br /&gt;
       Dim i As Integer&lt;br /&gt;
       For i = 0 To 4&lt;br /&gt;
           empCollection.Add(New Employee(i + 100))&lt;br /&gt;
           intCollection.Add((i * 5))&lt;br /&gt;
       Next i&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;add key/value pairs&lt;br /&gt;
       empCollection2.Add(New Employee(1989), &amp;quot;G W&amp;quot;)&lt;br /&gt;
       empCollection2.Add(New Employee(1997), &amp;quot;J A&amp;quot;)&lt;br /&gt;
       empCollection2.Add(New Employee(1901), &amp;quot;T J&amp;quot;)&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;print each member of the array&lt;br /&gt;
       For Each i In intCollection&lt;br /&gt;
           Console.Write(&amp;quot;{0} &amp;quot;, i.ToString(  ))&lt;br /&gt;
       Next i&lt;br /&gt;
  &lt;br /&gt;
       Console.WriteLine(  )&lt;br /&gt;
       Console.WriteLine(&amp;quot;Employee collection...&amp;quot;)&lt;br /&gt;
       Dim e As Employee&lt;br /&gt;
       For Each e In empCollection&lt;br /&gt;
           Console.Write(&amp;quot;{0} &amp;quot;, e.ToString(  ))&lt;br /&gt;
       Next e&lt;br /&gt;
  &lt;br /&gt;
       Console.WriteLine(  )&lt;br /&gt;
       Console.WriteLine(&amp;quot;Employee collection 2...&amp;quot;)&lt;br /&gt;
       For Each e In empCollection2&lt;br /&gt;
           Console.Write(&amp;quot;{0} &amp;quot;, e.ToString(  ))&lt;br /&gt;
       Next e&lt;br /&gt;
  &lt;br /&gt;
       Console.WriteLine(  )&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;retrieve an Employee by key&lt;br /&gt;
       Dim emp As Employee&lt;br /&gt;
       emp = empCollection2.Item(&amp;quot;J A&amp;quot;)&lt;br /&gt;
       Console.WriteLine( emp.ToString(  ))&lt;br /&gt;
  &lt;br /&gt;
       &amp;quot;note that indexing is 1-based (rather than zero based)&lt;br /&gt;
       emp = empCollection2.Item(1)&lt;br /&gt;
       Console.WriteLine(emp.ToString(  ))&lt;br /&gt;
   End Sub&lt;br /&gt;
End Class&lt;br /&gt;
     Public Class Employee&lt;br /&gt;
         Private myEmpID As Integer&lt;br /&gt;
         Public Sub New(ByVal empID As Integer)&lt;br /&gt;
             Me.myEmpID = empID&lt;br /&gt;
         End Sub &amp;quot;New&lt;br /&gt;
         Public Overrides Function ToString(  ) As String&lt;br /&gt;
             Return myEmpID.ToString(  )&lt;br /&gt;
         End Function &amp;quot;ToString&lt;br /&gt;
         Public Property EmpID(  ) As Integer&lt;br /&gt;
             Get&lt;br /&gt;
                 Return myEmpID&lt;br /&gt;
             End Get&lt;br /&gt;
             Set(ByVal Value As Integer)&lt;br /&gt;
                 myEmpID = Value&lt;br /&gt;
             End Set&lt;br /&gt;
         End Property&lt;br /&gt;
     End Class &amp;quot;Employee&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Collection.Remove==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Option Strict On&lt;br /&gt;
Public Module CollectionTest&lt;br /&gt;
   Public Sub Main()&lt;br /&gt;
      Dim weights As New Collection&lt;br /&gt;
      weights.Add(&amp;quot;ounces&amp;quot;, &amp;quot;oz&amp;quot;)&lt;br /&gt;
      weights.Add(&amp;quot;pounds&amp;quot;, &amp;quot;lbs&amp;quot;)&lt;br /&gt;
      weights.Add(&amp;quot;kilograms&amp;quot;, &amp;quot;kg&amp;quot;)&lt;br /&gt;
      weights.Add(&amp;quot;milligrams&amp;quot;, &amp;quot;mg&amp;quot;)&lt;br /&gt;
      For ordinal As Integer = weights.Count To 1 Step -1&lt;br /&gt;
         weights.Remove(ordinal)&lt;br /&gt;
      Next&lt;br /&gt;
      Console.WriteLine(&amp;quot;The collection now has {0} items.&amp;quot;, weights.Count)&lt;br /&gt;
   End Sub&lt;br /&gt;
End Module&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>