VB .NET Access .resx values

How do I access string values in the Resources (.resx) file ?
nightshadzAsked:
Who is Participating?
 
CodeCruiserCommented:
0
 
CodeCruiserCommented:
0
 
nightshadzAuthor Commented:
Can't get the first one to work.  I've tried

        Dim rm As New ResourceManager("Resources", _
            [Assembly].GetExecutingAssembly())

        Dim str As String = rm.GetString("ADPath")
        Console.WriteLine(str)

And get the error
A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
CodeCruiserCommented:
Have you added a resource file and strings?
0
 
nightshadzAuthor Commented:
Yes.

My file is Resources.resx
0
 
x77Commented:
Try using Namespace before Resources:
  "MyNamespace.Resources"

                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("CR.Resources", GetType(Resources).Assembly)
0
 
nightshadzAuthor Commented:
I used the Settings instead.  Much easier to do My.Settings.ADPath.

If I only need to store/access strings, is there a difference between using Settings and Resources?
0
 
CodeCruiserCommented:
If you only need to store strings then Settings is very useful indeed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.