PC Review


Reply
Thread Tools Rate Thread

Directory.GetFiles for multi-language file names?

 
 
=?Utf-8?B?Y2pi?=
Guest
Posts: n/a
 
      26th Sep 2006
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.
 
Reply With Quote
 
 
 
 
Michael Nemtsev
Guest
Posts: n/a
 
      27th Sep 2006
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

c> Is there a way to get Directory.GetFiles to return multi-language
c> file names? I haven't found any overloads that allow any such
c> parameter. The way I am using it now is:
c>
c> foreach (string d in Directory.GetDirectories("C:\\")) {
c> foreach (string f in Directory.GetFiles(d, "*.exe")) {
c> MessageBox.Show(f);
c> }
c> }
c> This will get all files except for the ones that do not have English
c> file 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 Nietzsch


 
Reply With Quote
 
 
 
 
Michael Nemtsev
Guest
Posts: n/a
 
      27th Sep 2006
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


c> Is there a way to get Directory.GetFiles to return multi-language
c> file names? I haven't found any overloads that allow any such
c> parameter. The way I am using it now is:
c>
c> foreach (string d in Directory.GetDirectories("C:\\")) {
c> foreach (string f in Directory.GetFiles(d, "*.exe")) {
c> MessageBox.Show(f);
c> }
c> }
c> This will get all files except for the ones that do not have English
c> file 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


 
Reply With Quote
 
=?Utf-8?B?Y2pi?=
Guest
Posts: n/a
 
      27th Sep 2006
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
>
> c> Is there a way to get Directory.GetFiles to return multi-language
> c> file names? I haven't found any overloads that allow any such
> c> parameter. The way I am using it now is:
> c>
> c> foreach (string d in Directory.GetDirectories("C:\\")) {
> c> foreach (string f in Directory.GetFiles(d, "*.exe")) {
> c> MessageBox.Show(f);
> c> }
> c> }
> c> This will get all files except for the ones that do not have English
> c> file 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"The file <file>.pst is not a personal folders file" Tanya J via OfficeKB.com Microsoft Outlook Discussion 10 7th Feb 2005 01:47 AM
Incorrect File Name in the File Open or File Save Dialog Boxes =?Utf-8?B?VGltIE1hY3JpbmE=?= Windows XP Internet Explorer 0 16th Jan 2005 06:33 AM
My "Open File" screen freezes when trying to open a file or attach a file. =?Utf-8?B?RGF2ZQ==?= Windows XP Help 0 30th Dec 2003 04:46 PM
file type changed from "file folder" to "file" in XP Pro J. Windows XP General 2 14th Dec 2003 08:47 PM
double click doesn't open the file// instead file->open->...the file open norma nks Microsoft Word New Users 1 3rd Oct 2003 03:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 PM.