ResourceWriter demo : Resources « GUI « VB.Net






ResourceWriter demo

  
Imports System
Imports System.Collections
Imports System.Resources

Module Module1

    Sub Main()
        Dim Rw As New ResourceWriter("my.resources")
        Dim Rr As ResourceReader
        Dim RrEn As IDictionaryEnumerator

        Rw.AddResource("key 1", "First value")
        Rw.AddResource("key 2", "Second value")
        Rw.AddResource("key 3", "Third value")
        Rw.Generate()
        Rw.Close()

        Rr = New ResourceReader("my.resources")
        RrEn = Rr.GetEnumerator
        Do While (RrEn.MoveNext)
            Console.WriteLine("Name: {0} - Value: {1}", RrEn.Key.ToString().PadRight(10, " "),RrEn.Value)
        Loop
        Rr.Close()

    End Sub

End Module

   
    
  








Related examples in the same category

1.ResXResourceWriter Demo
2.ResourceReader demo
3.ResourceSet demo
4.Localization: Find Resources-VB\Module1.vb