Resource Files
- From: "Bob" <bob@xxxxxxxxxxx>
- Date: Tue, 17 Oct 2006 10:12:44 +1300
Hi,
Trying to access some resource files that I originally created in a C# proj.
Added a copy of the "String1.resx" file to the VB project then opened My
Project and added the file to the resources.
This seemed happy enough in that it created a text file icon in the
resources panel.
But I am lost as to how to access it.
In C#
I would create a resource manager using a reference to the file in the
constructor.
rm = new ResourceManager("WidgetProj.StringRes1",
Assembly.GetExecutingAssembly());
The VB version of this executes without error but I can't get access to the
strings.
i.e.
myString =rm.GetString("String15") gives an error "Could not find any
resource appropriate for the specified culture or the neutral culture..."
Intellisense exposes the Resource File through the My.Resources.StringRes1
but not in any useful way that I can see.
I tried assigning to the Default resource manager exposed by My.Resources.
Although this executes OK it only returns empty strings
rm = My.Resources.ResourceManager()
Me.sbpSms.Text = rm.GetString("StringRes1.String121")
or
Me.sbpSms.Text = rm.GetString("String121")
both return empty strings. What is the correct way to access string resource
files that have been added to the project?
.
- Prev by Date: Re: Regex.Split... Can I do this??
- Next by Date: Re: Regex.Split... Can I do this??
- Previous by thread: Web Browser Control
- Next by thread: Re: sql server 2005 tools configuration starts when I build a dist
- Index(es):
Relevant Pages
|