473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Directory.GetFiles for multi-language file names?

cjb
Is there a way to get Directory.GetFiles to return multi-language file names?
I haven't found any overloads that allow any such parameter. The way I am
using it now is:

foreach (string d in Directory.GetDirectories("C:\\")) {
foreach (string f in Directory.GetFiles(d, "*.exe")) {
MessageBox.Show(f);
}
}

This will get all files except for the ones that do not have English file
names. Any help would be much apprecaited. Thanks you.
Sep 26 '06 #1
3 4123
Hello cjb,

Are u sure that you non-english file has .exe extension?
Because there is nothing wrong with this code, it shows any kind of language
name files

cIs there a way to get Directory.GetFiles to return multi-language
cfile names? I haven't found any overloads that allow any such
cparameter. The way I am using it now is:
c>
cforeach (string d in Directory.GetDirectories("C:\\")) {
cforeach (string f in Directory.GetFiles(d, "*.exe")) {
cMessageBox.Show(f);
c}
c}
cThis will get all files except for the ones that do not have English
cfile names. Any help would be much apprecaited. Thanks you.
c>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 27 '06 #2
Hello cjb,

Hello cjb,

Are u sure that your non-english file has .exe extension?
Because there is nothing wrong with this code, it shows any kind of language
name files
cIs there a way to get Directory.GetFiles to return multi-language
cfile names? I haven't found any overloads that allow any such
cparameter. The way I am using it now is:
c>
cforeach (string d in Directory.GetDirectories("C:\\")) {
cforeach (string f in Directory.GetFiles(d, "*.exe")) {
cMessageBox.Show(f);
c}
c}
cThis will get all files except for the ones that do not have English
cfile names. Any help would be much apprecaited. Thanks you.
c>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 27 '06 #3
cjb
I figured out my problem, thanks to a posting by someone in another forum.
What I didn't realize was that my snippet there didn't actually return files
underneath C:\.

I was pointed to use:

for each (string d in Directory.GetFiles("C:\\", "*.exe",
SearchOptions.AllDirectories)) {
MessageBox.Show(d);
}

That overloaded GetFiles function traverses all of the sub-directories and
it pulls all of the files in the top level as well.

Thanks for taking the time to respond. Hopefully this posting will help
someone else and they won't beat themselves up like I did thinking that it
wouldn't find multi-language file names!

"Michael Nemtsev" wrote:
Hello cjb,

Are u sure that you non-english file has .exe extension?
Because there is nothing wrong with this code, it shows any kind of language
name files

cIs there a way to get Directory.GetFiles to return multi-language
cfile names? I haven't found any overloads that allow any such
cparameter. The way I am using it now is:
c>
cforeach (string d in Directory.GetDirectories("C:\\")) {
cforeach (string f in Directory.GetFiles(d, "*.exe")) {
cMessageBox.Show(f);
c}
c}
cThis will get all files except for the ones that do not have English
cfile names. Any help would be much apprecaited. Thanks you.
c>
---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ALI-R | last post by:
I am using the follwoing code to get all files which have txt as an extension but I get an error that your search pattern is not correct.it seems this fuction dosn't accept "*.txt" as search...
2
by: John Smith | last post by:
Hello all: I am trying to search for more than one extension in a directory at the same time with the following code: string files = Directory.GetFiles(sDir, "*.doc*.dot"); However, this...
2
by: OpticTygre | last post by:
I have a directory of 27 files. The files end in either 1.txt, 2.txt, 3.txt, or 4.txt. If I say: For Each filename As String In...
3
by: Bill nguyen | last post by:
Is there a quick way to determine if a directory is empty. Directory.Getfiles() doesn't tell me how many files without having to loop thru the list. Thanks Bill
3
by: Michael | last post by:
Hi, I have been using Directory.GetFiles("g://"); in my c# application. But now my boss want's me to do Directory.GetFiles(IP address); I have been unable to figure out how to get this to work....
2
by: =?Utf-8?B?RGFuaWVsIENvcnLDqmE=?= | last post by:
Hi, I've been trying to use Directory.GetFiles() and also DirectoryInfo.GetFiles() to list files on a remote server using "\\server_name\dir_name" like paths. It works fine on a test windows...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
2
by: Nathan Sokalski | last post by:
I have an ASP.NET application which displays the directories & files in a specified directory on the server. I use the System.IO.Directory.GetDirectories() and System.IO.Directory.GetFiles() to...
2
by: Alex | last post by:
Hello, I'm creating a program to parse a directory and all files within that directory (including subdirectories), but 'directoryinfo' only parses the current directory. Is it possible to have...
0
by: tshad | last post by:
I am trying to do multiple Directory.GetFiles and append the results to one array that I will process. I tried this: string strFiles; strFiles = Directory.GetFiles(SemaSettings.InputFilePath,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.