M
Michael
I get all files from a directory an write it into an
array. Then I want get only the file name with file
extension without the full path.
//code
string[] aFilenames;
Directory.GetFiles(comandline.GetParameterValue
("sDirectory"));
for (int i=0; i < aFilenames.Length; i++)
{
// here I need only the file name!
}
//end code
For example:
sDirectory is "c:\tmp\test\"
and in the 'test' folder are two files:
test1.txt
test2.txt
For the sample I get
aFilesnames[0] = c:\tmp\test\test1.txt
aFilesnames[1] = c:\tmp\test\test2.txt
But I need only
aFilesnames[0] = test1.txt
aFilesnames[1] = test2.txt
Should I work with aFilesnames.Remove or something like
that, or which possibilities are there?
Thanks a lot for your assistance.
array. Then I want get only the file name with file
extension without the full path.
//code
string[] aFilenames;
Directory.GetFiles(comandline.GetParameterValue
("sDirectory"));
for (int i=0; i < aFilenames.Length; i++)
{
// here I need only the file name!
}
//end code
For example:
sDirectory is "c:\tmp\test\"
and in the 'test' folder are two files:
test1.txt
test2.txt
For the sample I get
aFilesnames[0] = c:\tmp\test\test1.txt
aFilesnames[1] = c:\tmp\test\test2.txt
But I need only
aFilesnames[0] = test1.txt
aFilesnames[1] = test2.txt
Should I work with aFilesnames.Remove or something like
that, or which possibilities are there?
Thanks a lot for your assistance.