Scott Stewart

Scott Stewart

  • 1.6k
  • 189
  • 18k

Using system classes

Feb 14 2012 9:25 AM
I am not sure if the title is even the correct use of the words system and classes. I was trying to write a function that looks for a specific file in a specific location. I added "using System.IO" to the directives and looking through the object browser I came across this;

"public override bool Exists { get; }
    Member of System.IO.FileInfo

Summary:
Gets a value indicating whether a file exists.

Returns:
true if the file exists; false if the file does not exist or if the file is a directory."

Generally speaking, how can I use this? I started to try FileInfo.Exists @"c:\file path\ and name.and extension" but that wasn't accepted. All I want is to set a boolean if the file exists.

Thank you again.

Answers (2)