Code for Working with Files under a Directory?
Answer / murty
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 ? | 3 Yes | 1 No |
Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long
working with arrays
How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)
How to add a value from textBox over an existing certain column in SQL Server
Code for Reading and writing from a file in c#?
IS Array list is generic or non generic
program for string reverse(eg:- i am boy -> boy am i)
8 Answers Black Pepper, Infosys, Mind Tree,
Code for Working with Files under a Directory?
how to change password in .net with c # with ado.net and also SQL server 2008 change password
program for straight line(y=mx+c)
How to Create Files by Using the FileInfo Class?
write a Program to copy the string using switch case.