Subjective Short Answer41. Write a program that prompts a user for a filename and tests the file's existence. If the file exists, display the file creation time. If it does not exist, display a message.

What will be an ideal response?


The program should be similar to the following:
using static System.Console;
using System.IO;
class FileStatistics
{
static void Main()
{
string fileName;
Write("Enter a filename >> ");
fileName = ReadLine();
if(File.Exists(fileName))
{
Writeline ("File exists");
WriteLine("File was created " +
File.GetCreationTime(fileName));
WriteLine("File was last accessed " +
File.GetLastAccessTime(fileName));
WriteLine("File was last written to " +
File.GetLastWrittenTime(fileName));
}
else
{
WriteLine("File does not exist");
}
}
}

Computer Science & Information Technology

You might also like to view...

After you create a local site folder, the next step is to ____ your website.

A. link B. define C. upload D. download

Computer Science & Information Technology

Lady Ada Lovelace is regarded as the world's first programmer on the basis of her correspondence with Charles Babbage and her published notes on his work with the Analytic Engine.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Why don’t most companies do full backup every night?

A. Full backups take a long time and thus companies usually only conduct full backups yearly. B. Full backups take a long time and thus companies usually only conduct full backups weekly. C. Full backups can't be restored. D. Full backups take a short time and thus companies usually only conduct full backups weekly.

Computer Science & Information Technology

An interactive PDF is a presentation-ready format, which means a document's interactivity is visible and able to be used.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology