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

where is assembly are store

5 Answers   C DAC,


How we implement the paypal in my website and how we make a payment through Credit Card.

2 Answers  


how to create a search bar which access data from various websites and retrieves the data

0 Answers  


What do you create for easier access of data?

3 Answers   NIIT,


Coding for .NET Delegates?

0 Answers  






HOw to Build a Nested GridView Control with ASP.NET?

2 Answers  


How to integrate the regional language in asp.net and c# like Telugu, Hindi etc,. send a sample program

3 Answers   Concept, NIIT, Wipro,


how can we close a web page in asp.net without using jscript?

4 Answers  


Data Reader Vs DataSet

5 Answers   TCS,


How to add checkbox to datagrid?

5 Answers  


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

3 Answers  


Code for Presenting Parent/Child Data in a Data Grid Row?

0 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)