469,133 Members | 1,447 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

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 1503
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Sean C. | last post: by
6 posts views Thread by Peter Frost | last post: by
5 posts views Thread by Drew | last post: by
1 post views Thread by BuddyWork | last post: by
reply views Thread by klemen.verdnik | last post: by
reply views Thread by chipxsd | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.