System.IO.File.Exists()関数を使います。 指定ファイルが存在するか否かを調べ 結果の真偽値を得ます。 System.IO.File.Exists()関数を利用します。C#
if ( System.IO.File.Exists(@"c:\HP\index.html") ) MessageBox.Show( "あったよママン!" ); else MessageBox.Show( "ないよぉ orz" );VB.NET
If System.IO.File.Exists("c:\HP\index.html") Then MessageBox.Show("あったよママン!") Else MessageBox.Show("ないよぉ orz") End IfVC.NET
if ( System::IO::File::Exists("c:\\HP\\index.html") ) MessageBox::Show( "あったよママン!" ); else MessageBox::Show( "ないよぉ orz" );
SEO | [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送 | ||