In .NET 2.0 a class is created that corresponds to the name of the
resource file.
So if your project's default namespace is DemoSite1 and you put
DemoSite1Resources.resx in the root folder, then you can access them
with:
DemoSite1.DemoSite1Resources.[resource name]
You can also see this in the solution since the resx file will have a
DemoSite1Resources.Designer.cs file associated with it which you can
open and view the namespace, class, and property definitions.
There are 3rd party custom tools to do this in VS.NET 2003 but afaik
only for strings. Here's one example:
http://www.codeproject.com/dotnet/Re...sGenerator.asp
HTH,
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On 14 Sep 2006 16:24:36 -0700, "Big Daddy" <jo********@yahoo.com>
wrote:
>I have added a resource file to my project called
"DemoSite1Resources.resx". I have seen an example in VB where you
could have type-safe access to the resources in your code like this:
btn.Text = My.Resources.DemoSite1Resources.btnCaption
But how can I have similar type-safe access to the resources in C#? I
have been able to do it in an ASP.NET application, but I haven't been
able to do it in a WinForms application.
Thanks in advance,
John