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

■ファイルが存在するか調べる

System.IO.File.Exists()関数を使います。
指定ファイルが存在するか否かを調べ
結果の真偽値を得ます。
System.IO.File.Exists()関数を利用します。

if ( System.IO.File.Exists(@"c:\HP\index.html") )
    MessageBox.Show( "あったよママン!" );
else
    MessageBox.Show( "ないよぉ orz" );





Copyright © 2008.07 - shougo suzaki