Code for Getting Information About A File?



Code for Getting Information About A File?..

Answer / senthil kumar

here we have the system.io base class in .net

FileInfo is the class which has the properties and methods
to display information about the file.
example code
FileInfo fi = new FileInfo("givepath");
Console.WriteLine("File Name:"+fi.Name);
Console.WriteLine("FullName:"+fi.FullName);
Console.WriteLine("Creation Time:"+fi.CreationTime);
Console.WriteLine("Last Access Time:"+fi.LastAccessTime);
Console.WriteLine("File Deleted :"+fi.Delete());

We can similarly know about the directory information using

DirectoryInfo di = new DirectoryInfo("path");

Is This Answer Correct ?    8 Yes 0 No

Post New Answer

More ASP.NET Code Interview Questions

how the value of label is printed through a button in asp.net web application

3 Answers  


How we use ajax in asp.net through javaScript. Please givee me an example.

0 Answers  


where is assembly are store

5 Answers   C DAC,


What do you create for easier access of data?

3 Answers   NIIT,


Coding for Synchronizing Cache Access in ASP.NET?

0 Answers  


Give coding for Implementing a Fixed GridView Header in ASP.NET?

1 Answers  


how to convert Dataset to Object Array or list in c# .net

4 Answers  


How to send e-mail from an ASP.NET application?

16 Answers   DataPoint, Infosys, Persistent, Radar, TCS, Wipro,


Code for a Simple Way to Write XML in .NET (XmlTextWriter)

1 Answers  


Coding for .NET Delegates?

0 Answers  


What is the code of Password Recovery or Forget your password? Plz tell in c # language.

0 Answers  


How to get the row index on checking a Checkbox in a ListView

1 Answers   TCS,


Categories
  • ASP.NET Code Interview Questions ASP.NET Code (46)
  • VB.NET Code Interview Questions VB.NET Code (9)
  • C Sharp Code Interview Questions C Sharp Code (51)
  • ADO.NET Code Interview Questions ADO.NET Code (8)