PC Review


Reply
Thread Tools Rate Thread

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

 
 
Bob Rock
Guest
Posts: n/a
 
      23rd May 2004
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



 
Reply With Quote
 
 
 
 
William Ryan eMVP
Guest
Posts: n/a
 
      24th May 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Bob Rock
Guest
Posts: n/a
 
      24th May 2004
"William Ryan eMVP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Ernest Morariu
Guest
Posts: n/a
 
      24th May 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "William Ryan eMVP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
>
>
>



 
Reply With Quote
 
Bob Rock
Guest
Posts: n/a
 
      24th May 2004
"Ernest Morariu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT - List of all embedded resources keys chipxsd Microsoft ASP .NET 0 2nd Nov 2006 02:40 PM
Problem/Error with Embedded Resources (Sound File) Vanessa Microsoft Dot NET Framework Forms 1 4th Aug 2005 04:23 PM
Problem/Error with Embedded Resources (Sound File) Vanessa Microsoft VB .NET 2 4th Aug 2005 04:23 PM
Getting the names of all the REsources embedded in a REsource File Saradhi Microsoft C# .NET 3 16th Nov 2004 01:08 PM
How to access keys and values of an embedded .resources file??? Bob Rock Microsoft Dot NET Framework Forms 4 24th May 2004 04:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 PM.