header
CodePanic! > C#.NET Tips > 今ここ

■ファイルサイズを取得する

System.IO.FileInfo の Lengthプロパティーを参照し、
指定ファイルのサイズをバイト単位で取得します。

System.IO.FileInfo fi = new System.IO.FileInfo( @"c:\hello.txt" );
MessageBox.Show( fi.Length.ToString() );





Copyright © 2008.07 - shougo suzaki