473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Resource File Woes

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


Nov 3 '06 #1
2 1012
"TCook" <ge**********@yahoo.comschrieb:
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/>

Nov 3 '06 #2
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]" <hi***************@gmx.atwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
"TCook" <ge**********@yahoo.comschrieb:
>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/>

Nov 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
2
by: Joe Thompson | last post by:
Hi, I am trying to use PlaySound in a VC++.net Windows app (VS 2003). I can use it to play a file but now I want to play it from a resource. I have two questions: How do I add a wav file to...
0
by: Johann Blake | last post by:
I'm having trouble grasping how ASP.NET correctly locates resources. There is plenty of documentation on this subject but some things are not clear at all. In my ASP.NET application, I have...
1
by: Bob | last post by:
Hi, My app is now successfully accessing the default Resources.resx. I have made a Resources.fr-FR.resx yet .. #if (French) Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR",...
11
by: Alan T | last post by:
I added a resource file into my project, to store the caption of buttons and labels.. How do I make use of this resource file to dynamically assign to the buttons and labels ?
0
by: TCook | last post by:
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" --...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
12
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.