C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Active Directory »

get in file information of a directory


Posted Date: 19 Jun 2009    Resource Type: Code Snippets    Category: Active Directory
Author: sarinMember Level: Gold    
Rating: 1 out of 5Points: 8 (Rs 5)



The Following codes set an example for getting the information of a directory in the console application using c# and .net


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.IO; //It is must



namespace fileInfo

{

class Program

{

static void Main(string[] args)

{




DirectoryInfo dirInfo = new DirectoryInfo(@"c:\");

FileInfo[] files = dirInfo.GetFiles(); // get a list of fileInfo




Console.WriteLine("Name:-Size:-Creation date:");

foreach (FileInfo file in files)

{

Console.Write(file.Name);

Console.Write(file.Length.ToString());

Console.WriteLine("\t" + file.CreationTime);



}

Console.Read();//press any key

}

}

}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Get in file information of a directory  .  C# Directory Info  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Check the active directory users using .net
Previous Resource: Group Object in Active Directory
Return to Discussion Resource Index
Post New Resource
Category: Active Directory


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use