다음을 통해 공유


ResourceSet.Close 메서드

ResourceSet에서 사용하는 모든 리소스를 닫고 해제합니다.

네임스페이스: System.Resources
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overridable Sub Close
‘사용 방법
Dim instance As ResourceSet

instance.Close
public virtual void Close ()
public:
virtual void Close ()
public void Close ()
public function Close ()

설명

이 메서드를 호출한 후 ResourceSet에서 메서드를 호출하면 잘못될 수 있습니다.

Close를 여러 번 안전하게 호출할 수 있습니다.

참고

현재 Close 구현에서는 Dispose(true)를 호출합니다.

예제

Imports System
Imports System.Resources
Imports System.Collections
Imports Microsoft.VisualBasic

Class EnumerateResources
   
   Public Shared Sub Main()
      ' Create a ResourceSet for the file items.resources.
      Dim rs As New ResourceSet("items.resources")      
      
      ' Create an IDictionaryEnumerator to read the data in the ResourceSet.
      Dim id As IDictionaryEnumerator = rs.GetEnumerator()
      
      ' Iterate through the ResourceSet and display the contents to the console. 
      While id.MoveNext()
         Console.WriteLine(ControlChars.NewLine + "[{0}] " + ControlChars.Tab + "{1}", id.Key, id.Value)
      End While 

      rs.Close()

   End Sub

End Class
using System;
using System.Resources;
using System.Collections;

class EnumerateResources 
{
    public static void Main() 
    {
        // Create a ResourceSet for the file items.resources.
        ResourceSet rs = new ResourceSet("items.resources"); 

        
        // Create an IDictionaryEnumerator to read the data in the ResourceSet.
        IDictionaryEnumerator id = rs.GetEnumerator(); 

        // Iterate through the ResourceSet and display the contents to the console. 
        while(id.MoveNext())
          Console.WriteLine("\n[{0}] \t{1}", id.Key, id.Value); 

        rs.Close();
 
    }
}
using namespace System;
using namespace System::Resources;
using namespace System::Collections;
int main()
{
   
   // Create a ResourceSet for the file items.resources.
   ResourceSet^ rs = gcnew ResourceSet( "items.resources" );
   
   // Create an IDictionaryEnumerator* to read the data in the ResourceSet.
   IDictionaryEnumerator^ id = rs->GetEnumerator();
   
   // Iterate through the ResourceSet and display the contents to the console.
   while ( id->MoveNext() )
      Console::WriteLine( "\n [{0}] \t {1}", id->Key, id->Value );

   rs->Close();
}
import System.*;
import System.Resources.*;
import System.Collections.*;

class EnumerateResources
{

    public static void main(String[] args)
    {
        // Create a ResourceSet for the file items.resources.
        ResourceSet rs = new ResourceSet("items.resources");

        // Create an IDictionaryEnumerator to read the data in the ResourceSet.
        IDictionaryEnumerator id = rs.GetEnumerator();

        // Iterate through the ResourceSet and display the contents to 
        // the console. 
        while (id.MoveNext()) {
            Console.WriteLine("\n[{0}] \t{1}", id.get_Key(), id.get_Value());
        }
        rs.Close();
    } //main 
} //EnumerateResources

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

ResourceSet 클래스
ResourceSet 멤버
System.Resources 네임스페이스