reading resx files for form texts

95se5m

Newcomer
Joined
Oct 4, 2005
Messages
8
I have some sample code that works great but I am confused. The only examples I have found anywhere read a file and loop through it. I need to grab individual items by a tag name to place it where I need it. Is there a way to do this?

Code:
    Public Sub ReadResourceFile()
        Dim myResEnum As IDictionaryEnumerator
        Dim objResXResourceReader As New ResXResourceReader("..\resources\ErrorMessages.resx")
        Dim txt As String = ""
        'Loop through
        myResEnum = objResXResourceReader.GetEnumerator()

        Do While myResEnum.MoveNext
            txt &= String.Concat(myResEnum.Key.ToString(), " - ", myResEnum.Value, vbCrLf)
        Loop
        MsgBox(txt)
        'Close up
        objResXResourceReader.Close()
    End Sub
 
Does the code you posted work, or does it not work? How is your data setup? If you could post a sample of the data it would be alot easier to assist you.
 
Back
Top