ResourceWriter.Dispose メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ResourceWriter.Dispose メソッドの意味・解説 

ResourceWriter.Dispose メソッド

リソース ファイルまたはストリーム閉じ明示的にリソース解放できます

名前空間: System.Resources
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

例外例外
解説解説

メソッド実装Close と同じです。

使用例使用例
Imports System
Imports System.Resources
Imports System.IO

Public Class WriteResources

  Public Shared Sub Main(ByVal
 args() As String)
      ' Create a file stream to encapsulate items.resources.
      Dim fs As New FileStream("items.resources",
 _
         FileMode.OpenOrCreate, FileAccess.Write)

      ' Open a resource writer to write from the stream.
      Dim writer = New ResourceWriter(fs)

      ' Add resources to the resource writer.
      writer.AddResource("String 1", "First
 String")
      writer.AddResource("String 2", "Second
 String")
      writer.AddResource("String 3", "Third
 String")

      ' Write the resources to the stream,  
      ' and clean up all resources associated with the writer.
      ' Calling Dispose is equivalent to calling Close.
      writer.Dispose()
   End Sub

End Class
using System;
using System.Resources;
using System.IO;

public class WriteResources 
{
    public static void Main(string[]
 args) 
    {  
        // Create a file stream to encapsulate items.resources.
        FileStream fs = new FileStream("items.resources",
 
           FileMode.OpenOrCreate,FileAccess.Write);

        // Open a resource writer to write from the stream.
        IResourceWriter writer = new ResourceWriter(fs);
    
        // Add resources to the resource writer.
        writer.AddResource("String 1", "First String");
        writer.AddResource("String 2", "Second String");
        writer.AddResource("String 3", "Third String");

        // Write the resources to the stream,  
        // and clean up all resources associated with the writer.
        // Calling Dispose is equivalent to calling Close.
        writer.Dispose();
    }
}
using namespace System;
using namespace System::Resources;
using namespace System::IO;
int main()
{
   // Create a file stream to encapsulate items.resources.
   FileStream^ fs = gcnew FileStream( "items.resources",FileMode::OpenOrCreate,FileAccess::Write
 );

   // Open a resource writer to write from the stream.
   IResourceWriter^ writer = gcnew ResourceWriter( fs );

   // Add resources to the resource writer.
   writer->AddResource( "String 1", "First String" );
   writer->AddResource( "String 2", "Second String" );
   writer->AddResource( "String 3", "Third String" );

   // Write the resources to the stream,
   // and clean up all resources associated with the writer.
   // Calling Dispose is equivalent to calling Close.
   writer->~IResourceWriter();
}
import System.*;
import System.Resources.*;
import System.IO.*;

public class WriteResources
{

    public static void main(String[]
 args)
    {
        // Create a file stream to encapsulate items.resources.
        FileStream fs = new FileStream("items.resources",
 
            FileMode.OpenOrCreate, FileAccess.Write);

        // Open a resource writer to write from the stream.
        IResourceWriter writer = new ResourceWriter(fs);

        // Add resources to the resource writer.
        writer.AddResource("String 1", "First String");
        writer.AddResource("String 2", "Second String");
        writer.AddResource("String 3", "Third String");

        // Write the resources to the stream,  
        // and clean up all resources associated with the writer.
        // Calling Dispose is equivalent to calling Close.
        writer.Dispose();
    } //main
} //WriteResources
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からResourceWriter.Dispose メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からResourceWriter.Dispose メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からResourceWriter.Dispose メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ResourceWriter.Dispose メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ResourceWriter.Dispose メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS