ResXResourceReader.Close 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
에서 사용하는 모든 리소스를 ResXResourceReader해제합니다.
public:
virtual void Close();
public void Close();
abstract member Close : unit -> unit
override this.Close : unit -> unit
Public Sub Close ()
구현
예제
다음 예제에서는 콘솔에 파일의 리소스를 표시한 다음 이 메서드를 사용하여 Close 판독기를 종료하고 다른 프로세스에서 해당 리소스를 사용할 수 있도록 합니다.
using System;
using System.Resources;
using System.Collections;
class ReadResXResources
{
public static void Main()
{
// Create a ResXResourceReader for the file items.resx.
ResXResourceReader rsxr = new ResXResourceReader("items.resx");
// Iterate through the resources and display the contents to the console.
foreach (DictionaryEntry d in rsxr)
{
Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString());
}
//Close the reader.
rsxr.Close();
}
}
Imports System.Resources
Imports System.Collections
Class ReadResXResources
Public Shared Sub Main()
' Create a ResXResourceReader for the file items.resx.
Dim rsxr As ResXResourceReader
rsxr = New ResXResourceReader("items.resx")
' Iterate through the resources and display the contents to the console.
Dim d As DictionaryEntry
For Each d In rsxr
Console.WriteLine(d.Key.ToString() + ":" + ControlChars.Tab + d.Value.ToString())
Next d
'Close the reader.
rsxr.Close()
End Sub
End Class
설명
호출 Close 을 사용하면 다른 용도로 재할당하는 데 사용되는 ResXResourceReader 리소스를 사용할 수 있습니다. 자세한 Close내용은 관리되지 않는 리소스 정리를 참조하세요.