Simple Demo for NameValueCollection : NameValueCollection « Data Structure « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Data Structure » NameValueCollectionScreenshots 
Simple Demo for NameValueCollection
Simple Demo for NameValueCollection

Imports System
Imports System.Collections
Imports System.Collections.Specialized


Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
        Dim nvc As New NameValueCollection
        nvc.Add("Value 1""Key 1")
        nvc.Add("Value 2""Key 2")
        nvc.Add("Value 3""Key 3")
        nvc.Add("Value 4""Key 4")
        nvc.Add("Value 5""Key 5")
        nvc.Add("Value 6""Key 6")
        nvc.Add("Value 7""Key 7")

        Dim values() As String
        For Each key As String In nvc.Keys
            Console.Write(key & ":")
            values = nvc.GetValues(key)
            For Each value As String In values
                Console.WriteLine("    " & value)
            Next value
        Next key

        Console.WriteLine()
        For Each key As String In nvc.Keys
            Console.WriteLine(key & ": " & nvc.Item(key))
        Next key
        
    End Sub
End Class
  

           
       
Related examples in the same category
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.