nightshadz
asked on
VB .NET Access .resx values
How do I access string values in the Resources (.resx) file ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can't get the first one to work. I've tried
Dim rm As New ResourceManager("Resources ", _
[Assembly].GetExecutingAss embly())
Dim str As String = rm.GetString("ADPath")
Console.WriteLine(str)
And get the error
A first chance exception of type 'System.Resources.MissingM anifestRes ourceExcep tion' occurred in mscorlib.dll
Dim rm As New ResourceManager("Resources
[Assembly].GetExecutingAss
Dim str As String = rm.GetString("ADPath")
Console.WriteLine(str)
And get the error
A first chance exception of type 'System.Resources.MissingM
Have you added a resource file and strings?
ASKER
Yes.
My file is Resources.resx
My file is Resources.resx
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
If I only need to store/access strings, is there a difference between using Settings and Resources?
If you only need to store strings then Settings is very useful indeed.
http://msdn.microsoft.com/en-us/library/ms227982.aspx