ResXResourceReader::Close Method ()
.NET Framework (current version)
Releases all resources used by the ResXResourceReader.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Calling Close enables the resources used by the ResXResourceReader to be reallocated for other purposes. For more information about Close, see Cleaning Up Unmanaged Resources.
The following example displays the resources of a file to the console, and then uses the Close method to shut down the reader and to make its resources available for other processes.
#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(); }
.NET Framework
Available since 1.1
Available since 1.1
Show: