Does a file exist : FileInfo « File Directory « Visual C++ .NET






Does a file exist

 

#include "stdafx.h"
using namespace System;
using namespace System::IO;
using namespace System::Text;

int main(array<System::String ^> ^args)
{

    FileInfo ^fileinfo = gcnew FileInfo("c:\\a.txt");

    if (!fileinfo->Exists)
    {
        Console::WriteLine("File Not Found");
        return -1;
    }
}

   
  








Related examples in the same category

1.Get the full name of a file
2.Get file creation time
3.Get file last access time
4.Get file last write time
5.Get file length
6.Get file attributes