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

FileStream.Unlock メソッド

他のプロセスにより以前ロックされファイル全部または一部へのアクセス許可します

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

例外例外
例外種類条件

ArgumentOutOfRangeException

position または length が負の値です。

解説解説
使用例使用例

次のコード例Lock メソッド例の一部です。

' Unlock the specified part of the file.
Case "U"C
    Try
        aFileStream.Unlock( _
            textLength - 1, byteCount)
        Console.WriteLine("The specified part " &
 _
            "of file has been unlocked.")
    Catch ex As IOException
        Console.WriteLine( _
            "{0}: The specified part of file " &
 _
            "is not locked by the current " &
 _
            "process.", ex.GetType().Name)
    End Try
    Exit Select
// Unlock the specified part of the file.
case 'U':
    try
    {
        fileStream.Unlock(
            textLength - 1, byteCount);
        Console.WriteLine("The specified part " +
            "of file has been unlocked.");
    }
    catch(IOException e)
    {
        Console.WriteLine(
            "{0}: The specified part of file is " +
            "not locked by the current process.", 
            e.GetType().Name);
    }
    break;
// Unlock the specified part of the file.
case 'U':
   try
   {
      fileStream->Unlock( textLength - 1, byteCount );
      Console::WriteLine( "The specified part "
      "of file has been unlocked." );
   }
   catch ( IOException^ e ) 
   {
      Console::WriteLine( "{0}: The specified part of file is "
      "not locked by the current process.", e->GetType()->Name );
   }

   break;

default:
   
// Unlock the specified part of the file.
case 'U' : 
    try {
        fileStream.Unlock(textLength - 1, byteCount);
        Console.WriteLine(("The specified part "
            + "of file has been unlocked."));
    }
    catch(IOException e) {                            
        Console.WriteLine(
            "{0}: The specified part of file is "
            + "not locked by the current process.",
            e.GetType().get_Name());
    }
    break;
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS