using System;
using System.IO;
class Filecheck
{
static void Main()
{
FileInfo info = new FileInfo("D:\\ABV\\doc.txt");
bool exists = info.Exists;
if (exists == true)
{
Console.WriteLine("The File Exists in the drive");
}
else
{
Console.WriteLine("No Such File Found");
}
Console.Read();
}
}
-----------------------
OUTPUT:- The File Exists in the drive
---------------------------------
using System.IO;
class Filecheck
{
static void Main()
{
FileInfo info = new FileInfo("D:\\ABV\\doc.txt");
bool exists = info.Exists;
if (exists == true)
{
Console.WriteLine("The File Exists in the drive");
}
else
{
Console.WriteLine("No Such File Found");
}
Console.Read();
}
}
-----------------------
OUTPUT:- The File Exists in the drive
---------------------------------
No comments:
Post a Comment