472,805 Members | 1,101 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to access resource files

I can't find a good solid example on how to access strings from a resource
file.
I know i need to create a ResourceManager object, and then call the
GetString method on it. My problem is that if i try to access anything from
a resource file other than one of the ones connected with a Form, it can
never find it.
So can someone just point me in the right direction with this...

I add an Assembly Resource File called MyStrings.resx to my project.
I then go in and add in a couple lines to the resource file such as

StringA, This is my StringA, null, null, null
StringB, This is my StringB, null, null, null

now, if i want to pull one of these strings from a function in any class in
my assembly, how do i go about doing it?

System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(???);
resources.GetString(???)

Thanks in advance for the clarification!

Tim
Nov 15 '05 #1
1 8936
nevermind, i figured it out.
"Tim Mulholland" <Mu***************@alumni.virginia.edu> wrote in message
news:u5**************@TK2MSFTNGP11.phx.gbl...
I can't find a good solid example on how to access strings from a resource
file.
I know i need to create a ResourceManager object, and then call the
GetString method on it. My problem is that if i try to access anything from a resource file other than one of the ones connected with a Form, it can
never find it.
So can someone just point me in the right direction with this...

I add an Assembly Resource File called MyStrings.resx to my project.
I then go in and add in a couple lines to the resource file such as

StringA, This is my StringA, null, null, null
StringB, This is my StringB, null, null, null

now, if i want to pull one of these strings from a function in any class in my assembly, how do i go about doing it?

System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(???);
resources.GetString(???)

Thanks in advance for the clarification!

Tim

Nov 15 '05 #2

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

Similar topics

3
by: ajdfljsdf | last post by:
After some basic research, I am still somewhat unclear on how Access would be used in a workgroup setting. Basically, we want to run 10 MS Access clients to access an MS Access database on a...
3
by: Marc Nadeau | last post by:
Hi, I have a new project that consist of transfering a JD Edwards Database to an MS Access database. I am just starting to learn how those 2 databases works. What is the general idea behind...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
4
by: Bruce | last post by:
I am developing an ASP.NET web service application. It works fine on my WinXP Prof development machine. But when I send it to a Windows Server 2003 system I get the following error (attached...
1
by: Steve Franks | last post by:
I'd like to set up a certain part of my web tree so that no browsers can access files from that directory and any directories below it. I will store certain resouces like xml files and other...
0
by: M | last post by:
I installed the Visual Basic .NET Resource Kit. When I click 'Visual Basic .NET Resource Kit' the page at 'http://localhost/VB.NETResourceKit/Welcome.aspx' show: Server Error in...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
1
by: joshtichauer | last post by:
So i have an xml file, i'm grabbing it via dataset, then placing the data into a datagrid. everythings all good, but i'd like to edit the data. the coding grabs whats in the edit textboxes, and...
4
by: Anbu | last post by:
Hi all, I have developed an application in VS .NET 2003 (framework 1.1) on a XP platform. It is working fine in that PC. Now, I setup new PC with same configuration for another develper....
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?

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.