FileStream.Length プロパティ
名前空間: System.IO
アセンブリ: mscorlib (mscorlib.dll 内)
構文
その他の一般的な I/O タスクまたは関連する I/O タスクの例を次の表に示します。
File.AppendText FileInfo.AppendText | |
File.Move FileInfo.MoveTo | |
File.Copy FileInfo.CopyTo | |
FileInfo.Length | |
File.GetAttributes | |
File.SetAttributes | |
CreateSubdirectory | |
GetFileSystemInfos |
Length プロパティと Position プロパティを使用して EOF (end-of-file) 条件を確認する例を次に示します。
If s.Length = s.Position Then Console.WriteLine("End of file has been reached.") End If
if( s.Length==s.Position ) { Console.WriteLine("End of file has been reached."); }
if ( s->Length == s->Position ) { Console::WriteLine( "End of file has been reached." ); }
if (s.get_Length() == s.get_Position()) { Console.WriteLine("End of file has been reached."); }
if( s.Length==s.Position ) Console.WriteLine("End of file has been reached.");
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- FileStream.Length プロパティのページへのリンク