ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  Dot Net Code  >>  C Sharp Code
 
 


 

 
 ASP.NET Code interview questions  ASP.NET Code Interview Questions
 VB.NET Code interview questions  VB.NET Code Interview Questions
 C Sharp Code interview questions  C Sharp Code Interview Questions
 ADO.NET Code interview questions  ADO.NET Code Interview Questions
Question
Code for Working with Files under a Directory?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Code for Working with Files under a Directory?
Answer
# 1
Suppose that you want to list all BMP files under the 
f:\Pictures directory. You can write a code as shown in the 
code snippet given in Listing 3: 

Listing

DirectoryInfo dir = new DirectoryInfo(@"F:\WINNT");
FileInfo[] bmpfiles = dir.GetFiles("*.bmp);
Console.WriteLine("Total number of bmp files", 
bmpfiles.Length);
Foreach( FileInfo f in bmpfiles)
{
  Console.WriteLine("Name is : {0}", f.Name);
  Console.WriteLine("Length of the file is : {0}", 
f.Length);
  Console.WriteLine("Creation time is : {0}", 
f.CreationTime);
  Console.WriteLine("Attributes of the file are : {0}",
                    f.Attributes.ToString());
}
 
Is This Answer Correct ?    0 Yes 0 No
Murty
 

 
 
 
Other C Sharp Code Interview Questions
 
  Question Asked @ Answers
 
How to use ASP.NET 2.0's TreeView to Display Hierarchical Data?  1
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#  1
How to Create a Treeview Menu in ASP.NET with C#?  1
Event Handling in C# Triggering a Button  1
"c sharp" code for factorial using static variables  4
Code for Working with Files under a Directory?  1
 
For more C Sharp Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com