Click here to Skip to main content
16,006,378 members
Home / Discussions / C#
   

C#

 
GeneralGetting Started in Software Dev. Pin
jtmtv185-Feb-03 14:40
jtmtv185-Feb-03 14:40 
GeneralRe: Getting Started in Software Dev. Pin
Taka Muraoka5-Feb-03 15:12
Taka Muraoka5-Feb-03 15:12 
GeneralRe: Getting Started in Software Dev. Pin
jtmtv185-Feb-03 15:24
jtmtv185-Feb-03 15:24 
GeneralRe: Getting Started in Software Dev. Pin
Taka Muraoka5-Feb-03 15:35
Taka Muraoka5-Feb-03 15:35 
GeneralRe: Getting Started in Software Dev. Pin
jtmtv185-Feb-03 15:47
jtmtv185-Feb-03 15:47 
GeneralRe: Getting Started in Software Dev. Pin
Taka Muraoka5-Feb-03 15:51
Taka Muraoka5-Feb-03 15:51 
Questionhow to get all the files names in one folder? Pin
clarkwuzhe5-Feb-03 11:59
clarkwuzhe5-Feb-03 11:59 
AnswerRe: how to get all the files names in one folder? Pin
Paresh Gheewala5-Feb-03 12:30
Paresh Gheewala5-Feb-03 12:30 
using System;
using System.IO;
using System.Collections;


// Takes an array of file names or directory names on the command line.
// Determines what kind of name it is and processes it appropriately
public class RecursiveFileProcessor {
public static void Main(string[] args) {
foreach(string path in args) {
if(File.Exists(path)) {
// This path is a file
ProcessFile(path);
}
else if(Directory.Exists(path)) {
// This path is a directory
ProcessDirectory(path);
}
else {
Console.WriteLine("{0} is not a valid file or directory.", path);
}
}
}


// Process all files in the directory passed in, and recurse on any directories
// that are found to process the files they contain
public static void ProcessDirectory(string targetDirectory) {
// Process the list of files found in the directory
string [] fileEntries = Directory.GetFiles(targetDirectory);
foreach(string fileName in fileEntries)
ProcessFile(fileName);

// Recurse into subdirectories of this directory
string [] subdirectoryEntries = Directory.GetDirectories(targetDirectory);
foreach(string subdirectory in subdirectoryEntries)
ProcessDirectory(subdirectory);
}

// Real logic for processing found files would go here.
public static void ProcessFile(string path) {
Console.WriteLine("Processed file '{0}'.", path);
}
}

This program will allow you to select all the files and subdirectory
once you pass the folder name

PareshSmile | :)
AnswerRe: how to get all the files names in one folder? Pin
Paresh Gheewala5-Feb-03 13:13
Paresh Gheewala5-Feb-03 13:13 
QuestionHow to tell whether a string is a number? Pin
clarkwuzhe5-Feb-03 11:30
clarkwuzhe5-Feb-03 11:30 
AnswerRe: How to tell whether a string is a number? Pin
Paresh Gheewala5-Feb-03 11:37
Paresh Gheewala5-Feb-03 11:37 
GeneralRe: How to tell whether a string is a number? Pin
clarkwuzhe5-Feb-03 11:39
clarkwuzhe5-Feb-03 11:39 
GeneralRe: How to tell whether a string is a number? Pin
Paresh Gheewala5-Feb-03 11:42
Paresh Gheewala5-Feb-03 11:42 
GeneralRe: How to tell whether a string is a number? Pin
Paresh Gheewala5-Feb-03 11:45
Paresh Gheewala5-Feb-03 11:45 
GeneralRe: How to tell whether a string is a number? Pin
clarkwuzhe5-Feb-03 11:46
clarkwuzhe5-Feb-03 11:46 
GeneralRe: How to tell whether a string is a number? Pin
Paresh Gheewala5-Feb-03 11:51
Paresh Gheewala5-Feb-03 11:51 
AnswerRe: How to tell whether a string is a number? Pin
Vasudevan Deepak Kumar5-Feb-03 17:53
Vasudevan Deepak Kumar5-Feb-03 17:53 
AnswerRe: How to tell whether a string is a number? Pin
Ian Darling5-Feb-03 23:04
Ian Darling5-Feb-03 23:04 
AnswerRe: How to tell whether a string is a number? Pin
Richard Deeming6-Feb-03 0:33
mveRichard Deeming6-Feb-03 0:33 
GeneralRe: How to tell whether a string is a number? Pin
Vasudevan Deepak Kumar6-Feb-03 2:22
Vasudevan Deepak Kumar6-Feb-03 2:22 
GeneralRe: How to tell whether a string is a number? Pin
Richard Deeming6-Feb-03 2:33
mveRichard Deeming6-Feb-03 2:33 
GeneralRe: How to tell whether a string is a number? Pin
Vasudevan Deepak Kumar7-Feb-03 0:11
Vasudevan Deepak Kumar7-Feb-03 0:11 
GeneralRe: How to tell whether a string is a number? Pin
Richard Deeming7-Feb-03 0:15
mveRichard Deeming7-Feb-03 0:15 
GeneralTabbing MDI childs Pin
thedex5-Feb-03 11:11
thedex5-Feb-03 11:11 
GeneralRe: Tabbing MDI childs Pin
Vasudevan Deepak Kumar6-Feb-03 2:29
Vasudevan Deepak Kumar6-Feb-03 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.