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 copy the string using switch case.
How to use ASP.NET 2.0's TreeView to Display Hierarchical Data?
c# coding for a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors not using the Big-integer and Exponential Function's.
Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik
how to change password in .net with c # with ado.net and also SQL server 2008 change password
Coding for using Nullable Types in C#?
c# code to Count number of 1's in a given range of integer (0 to n)
How to Create Files by Using the FileInfo Class?
Write a program. there are 1..n numbers placed in an array in random fashion with one integer missing. find the missing number.
How to add a value from textBox over an existing certain column in SQL Server
Code for Reading and writing from a file?
how does the below eqation proceed to be solved: x*=y+z options: x=x*y+z or x=x*(y+z)