HighTechTalks DotNet Forums  

Resource File Woes

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss Resource File Woes in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
TCook
 
Posts: n/a

Default Resource File Woes - 11-03-2006 , 03:46 PM






Hey All,

I'm trying to add a resource file to my app but it's not working.

I have done the following:

-- Added a .resx file
-- Added some strings
-- Named the file "MyStrings.en.resx"
-- Add the file as a resource to the "Project" > "Properties" > "Resources"
-- Tried to call the strings using:
Dim rm As ResourceManager
rm = New ResourceManager("StringTable", Me.GetType().Assembly)
MessageBox.Show(rm.GetString("String1"))

Clearly I'm missing something. How do these .resx files need to be added in
order to work properly?

I've looked at the documentation online and I don't see it.

Please advise.

Thanks,

TC





Reply With Quote
  #2  
Old   
Herfried K. Wagner [MVP]
 
Posts: n/a

Default Re: Resource File Woes - 11-03-2006 , 06:39 PM






"TCook" <getmyemails2 (AT) yahoo (DOT) com> schrieb:
Quote:
I'm trying to add a resource file to my app but it's not working.

I have done the following:

-- Added a .resx file
-- Added some strings
-- Named the file "MyStrings.en.resx"
-- Add the file as a resource to the "Project" > "Properties"
"Resources"
-- Tried to call the strings using:
Dim rm As ResourceManager
rm = New ResourceManager("StringTable", Me.GetType().Assembly)
MessageBox.Show(rm.GetString("String1"))

Why aren't you using 'My.Resources.*'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



Reply With Quote
  #3  
Old   
TCook
 
Posts: n/a

Default Re: Resource File Woes - 11-03-2006 , 10:41 PM



Hey Herfried,

Thanks for the info. Now I see!

I added the strings under the project properties and Voila!, I could call
the data in code via intellisense.

However, the above said, what about all of this stuff:



Dim rm As ResourceManager
rm = New ResourceManager("StringTable", Me.GetType().Assembly)

Message = New StringBuilder()
Message.Append(rm.GetString("String1"))
Message.Append(rm.GetString("String2"))


Where does code like the above come into play?

Regards,

TC



"Herfried K. Wagner [MVP]" <hirf-spam-me-here (AT) gmx (DOT) at> wrote

Quote:
"TCook" <getmyemails2 (AT) yahoo (DOT) com> schrieb:
I'm trying to add a resource file to my app but it's not working.

I have done the following:

-- Added a .resx file
-- Added some strings
-- Named the file "MyStrings.en.resx"
-- Add the file as a resource to the "Project" > "Properties"
"Resources"
-- Tried to call the strings using:
Dim rm As ResourceManager
rm = New ResourceManager("StringTable", Me.GetType().Assembly)
MessageBox.Show(rm.GetString("String1"))


Why aren't you using 'My.Resources.*'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/
V B <URL:http://dotnet.mvps.org/dotnet/faqs/



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.