473,389 Members | 1,093 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,389 software developers and data experts.

How to access keys and values of an embedded .resources file???

Hello,

I'd like to programmatically access keys and values of on .resources file
embedded in my assembly.
I've seen that the assembly class provides the GetManifestResourceStream
method .... but then I don't know I to access single keys and values inside
the same .resources file. I'd like to be able to do something like what is
possible with the ResourceManager class but I haven't found a way to use it
with embedded resources but only with external resource files.
Bob Rock

Nov 22 '05 #1
4 1707
http://www.knowdotnet.com/articles/ddl.html
http://www.knowdotnet.com/articles/configfiles.html

--
W.G. Ryan MVP Windows - Embedded

www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
"Bob Rock" <no***************************@hotmail.com> wrote in message
news:2h************@uni-berlin.de...
Hello,

I'd like to programmatically access keys and values of on .resources file
embedded in my assembly.
I've seen that the assembly class provides the GetManifestResourceStream
method .... but then I don't know I to access single keys and values inside the same .resources file. I'd like to be able to do something like what is
possible with the ResourceManager class but I haven't found a way to use it with embedded resources but only with external resource files.
Bob Rock

Nov 22 '05 #2
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
http://www.knowdotnet.com/articles/ddl.html
http://www.knowdotnet.com/articles/configfiles.html

--
W.G. Ryan MVP Windows - Embedded

www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/


I've looked at both articles. The second contains nothing useful. The first
does not show what I asked for.
Suppose I have a SINGLE embedded .resources file in my assembly containing
MANY key/value pairs. I'd like to be able to access the different values
passing in the key. How can I accomplish this???

Bob Rock

Nov 22 '05 #3
dim resourceName as string
resourceName="<YourNameSpace>.<ResourceName>" ' resource name must be
without extension
' sample: resourceName="Emergency.myResource"

Dim resources As New ResourceManager(resourceName,
[Assembly].GetExecutingAssembly()))

Dim searchedKey as String
Dim FoundValue as String
searchedKey ="?????"
FoundValue = CType(resources.GetObject(searchedKey ), String)

Ernest

"Bob Rock" <no***************************@hotmail.com> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
http://www.knowdotnet.com/articles/ddl.html
http://www.knowdotnet.com/articles/configfiles.html

--
W.G. Ryan MVP Windows - Embedded

www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
I've looked at both articles. The second contains nothing useful. The

first does not show what I asked for.
Suppose I have a SINGLE embedded .resources file in my assembly containing
MANY key/value pairs. I'd like to be able to access the different values
passing in the key. How can I accomplish this???

Bob Rock

Nov 22 '05 #4
"Ernest Morariu" <er****@gesora.com> wrote in message
news:uA**************@TK2MSFTNGP10.phx.gbl...
dim resourceName as string
resourceName="<YourNameSpace>.<ResourceName>" ' resource name must be
without extension
' sample: resourceName="Emergency.myResource"

Dim resources As New ResourceManager(resourceName,
[Assembly].GetExecutingAssembly()))

Dim searchedKey as String
Dim FoundValue as String
searchedKey ="?????"
FoundValue = CType(resources.GetObject(searchedKey ), String)

Ernest


Ernest,

I did not know that you could use the ResourceManager class to access
embedded resource files ... I have always used it to access external
..resources and .resx files. Thx.

Bob Rock

Nov 22 '05 #5

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

Similar topics

14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
5
by: Drew | last post by:
Assembly asm = Assembly.GetExecutingAssembly(); me = new Bitmap(asm.GetManifestResourceStream("me.gif")); I have used this before without any problem, but now I get: An unhandled exception...
1
by: BuddyWork | last post by:
Hello, If you copy the source code from this post into seperate files as stated, and compile the code. Now to reproduce run the code in debug. 1. Press the Client button. 2. Put the cursor...
7
by: Wysiwyg | last post by:
Is there any way to add an embedded resource to a project without copying it to the project's directory? I have shared resources and don't want each project using the images, xml files, etc. to...
4
by: Jon Rista | last post by:
I have a project where I need to create a windows .exe by compiling code and linking in some resources. This program thats being generated is somewhat unconventional, and I'll explain how. I'm...
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...
0
by: klemen.verdnik | last post by:
Hi... I'm having some difficulties getting all possible keys from a specific resource class. Let's say I have a file named: MyProj.TranslationStrings.resx in my App_GlobalResources folder ...
0
by: chipxsd | last post by:
Folks, please I need your help! I use the .resx to embed the resources in to the assembly. I'm curious how do I get the list of all resources from the assembly. One of my .resx file looks like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.