FileInfo myfile = new FileInfo(@"H:\myphoto.jpg");
if (myfile.Exists)
{
Console.WriteLine("File name : {0}", myfile.Name);
Console.WriteLine("Path : {0}", myfile.FullName);
Console.WriteLine("Creation Time: {0}", myfile.CreationTime);
Console.WriteLine("Length : {0}", myfile.Length);
}
Note: "@" this symbol is used in string type to turn off escape processing. i.e If escape processing is turned on compiler will look for valid escape characters, if there is any invalid escape symbol it will throw compilation error.
No comments:
Post a Comment