Last post Oct 20, 2010 02:03 AM by amodius
Oct 19, 2010 02:04 AM|amodius|LINK
i need to add a string in a existing resource file
i am trying this but does not work
do you know the problem?
Private Function AddString(ByVal file As String, ByVal result As String)
Dim language As Google.API.Language = Google.API.Language.English
Dim resxFilePath As String = file '"c:\files"
Using rr As New ResXResourceReader(resxFilePath)
Dim outputFilePath As String = resxFilePath.Replace(".vb", "") & ".resx"
Using rw As New ResXResourceWriter(outputFilePath)
rw.AddResource(result, Replace(result, Chr(34), ""))
Oct 19, 2010 10:49 PM|decker dong - msft|LINK
Public Class writeresources
Public Shared Sub main(args() As String)
' creates a resource writer.
Dim writer = New resourcewriter("myresources.resources") 'Auto-Adding string, please assign the file first
' adds resources to the resource writer.
writer.addresource("string 1", "first string")
writer.addresource("string 2", "second string")
writer.addresource("string 3", "third string")
' writes the resources to the file or stream, and closes it.
End Sub 'main
End Class 'writeresources
Oct 20, 2010 02:03 AM|amodius|LINK
i have another little problem
i need use this function for both my web application and my windows Form application too
the difference about windos and web is that in Windows Application there is an .desiner file for each resource
and i have some problem
i need create a generic function