Esto no sé hacerlo así que he buscado en Google,
He probado las 2 maneras que se comentan aquí pero ninguna me funciona: http://stackoverflow.com/questions/1000510/how-to-get-the-names-of-all-resources-in-a-resource-file
Necesito hacer algo así:
Private Sub SearchInResources(ByVal PatternSTR As String)
For Each ResourceFile In My.Resources ' Esto no funciona cláramente xD
If ResourceFile.EndsWith(".txt") Then
Dim fileContent As String = ResourceFile
Dim stringStream As New System.IO.StringReader(fileContent)
If stringStream.contains(PatternSTR) Then
' Cosas...
End If
End If
Next
End Sub
obtener todos los strings de esta forma:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ResourceSet As Resources.ResourceSet = My.Resources.ResourceManager.GetResourceSet(Globalization.CultureInfo.CurrentCulture, True, True)
For Each Dict As DictionaryEntry In ResourceSet.OfType(Of Object)()
If TypeOf (Dict.Value) Is String Then
Debug.WriteLine(Dict.Value)
End If
Next
End Sub
End Class
saludos.
Perfecto!
^^
Justo ahora mismo habia sacado ese mismo code en StackOverF... e iba a preguntar cual era el correcto "TypeOf" que debía usar, ya me has sacado de dudas xD
Dim ResourceSet As Resources.ResourceSet = My.Resources.ResourceManager.GetResourceSet(Globalization.CultureInfo.CurrentCulture, True, True)
For Each Dict As DictionaryEntry In ResourceSet.OfType(Of Object)()
If TypeOf (Dict.Value) Is Drawing.Image Then
Debug.WriteLine(Dict.Key) 'outputting resource name
End If
Next