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 |
Code for Reading and writing from a file?
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 Create a Treeview Menu in ASP.NET with C#?
I am developing a web application using google map api.I want to update the map inside the div control within update panel. I got other controls updated but map doesn't get updated.I do not not want to update map whenever unnecessary controls are fired at server side.How could it be achieved?
program to reverse the order of words in a string.
Coding for Manipulate XML File Data Using C#?
Code for Searching for Multiple Matches with the MatchCollection Class?
. Write a program to print the following outputs using for loops $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
Write a program to convert postfix expression to infix expression.
How to add a value from textBox over an existing certain column in SQL Server
How to Create Files by Using the FileInfo Class?
Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.