ResXResourceReader Constructor (String^)
.NET Framework (current version)
Initializes a new instance of the ResXResourceReader class for the specified resource file.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- fileName
-
Type:
System::String^
The path of the resource file to read.
The following example creates a new instance of the ResXResourceReader class for the specified file, iterates through the resources of the file, and displays the contents to the console.
#using <system.windows.forms.dll> #using <System.dll> using namespace System; using namespace System::Resources; using namespace System::Collections; void main() { // Create a ResXResourceReader for the file items.resx. ResXResourceReader^ rsxr = gcnew ResXResourceReader( "items.resx" ); // Iterate through the resources and display the contents to the console. IEnumerator^ myEnum = rsxr->GetEnumerator(); while ( myEnum->MoveNext() ) { DictionaryEntry^ d = safe_cast<DictionaryEntry^>(myEnum->Current); Console::WriteLine( "{0}:\t {1}", d->Key, d->Value ); } //Close the reader. rsxr->Close(); }
SecurityAction::LinkDemandSecurityAction::InheritanceDemand
for full trust for the immediate caller. This member cannot be used by partially trusted code.
for full trust for inheritors. This member cannot be inherited by partially trusted code.
.NET Framework
Available since 1.1
Available since 1.1
Show: