Click here to Skip to main content
15,913,055 members
Home / Discussions / C#
   

C#

 
GeneralRe: size of text array - limitations Pin
J4amieC15-Jan-07 3:13
J4amieC15-Jan-07 3:13 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:19
electriac15-Jan-07 3:19 
GeneralRe: size of text array - limitations Pin
J4amieC15-Jan-07 3:34
J4amieC15-Jan-07 3:34 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:37
electriac15-Jan-07 3:37 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:34
electriac15-Jan-07 3:34 
GeneralRe: size of text array - limitations Pin
Pete O'Hanlon15-Jan-07 3:21
mvePete O'Hanlon15-Jan-07 3:21 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:44
electriac15-Jan-07 3:44 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 11:04
electriac15-Jan-07 11:04 
I have tested this further and it gets curious-er. I installed a drive that has nothing but MP3 files on it. I went in a command com and issued a “Dir *.mp3 /b /s > test.txt” to create a list of all the files on the drive. I read the file with a text editor and there are 17,247 files listed. Okay I run the program I have been testing and it finds only 16800 files. Here is the code I used to which I introduced a counter with which I report to a message box in order to confirm the exact number in the array. The number in the array agrees with countFiles.

<br />
void DirSearch(string sDir)<br />
        {<br />
            try<br />
            {<br />
                foreach (string d in Directory.GetDirectories(sDir))<br />
                {<br />
                    foreach (string f in Directory.GetFiles(d, "*.mp3"))<br />
                    {<br />
                        //listBox1.Items.Add(f);<br />
                        arrText.Add(f);<br />
                        countFiles++;<br />
                    }<br />
                    DirSearch(d);<br />
                }<br />
            }<br />
            catch (System.Exception excpt)<br />
            {<br />
                Console.WriteLine(excpt.Message);<br />
            }<br />
        }<br />


Upon examintion of the array in the list box there is also 16,800 files in the list box but I notice that I have a directory for “World” music which is not present in the list. Out of curiosity I change the name of the directory from “World” to “aWorld” and run the program without any other changes. The program reports 17,005 files which reflects the approximate number of files in the “World” directory.

It seems that there is something strange happening in DirSearch that is beyond my feeble mind. Since it will not read anything alphabeticaly beyond “Rock and Roll” could there be some kind of musical prejudice at work? That’s a joke.
GeneralRe: size of text array - limitations Pin
Luc Pattyn15-Jan-07 3:55
sitebuilderLuc Pattyn15-Jan-07 3:55 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 4:47
electriac15-Jan-07 4:47 
GeneralRe: size of text array - limitations Pin
Luc Pattyn15-Jan-07 4:53
sitebuilderLuc Pattyn15-Jan-07 4:53 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 5:02
electriac15-Jan-07 5:02 
AnswerRe: size of text array - limitations Pin
mihksoft15-Jan-07 20:57
mihksoft15-Jan-07 20:57 
GeneralRe: size of text array - limitations [modified] Pin
electriac15-Jan-07 21:09
electriac15-Jan-07 21:09 
QuestionAssigning the result of an SQL ExecuteScalar() to an int? Pin
Red_Wizard_Shot_The_Food15-Jan-07 1:42
Red_Wizard_Shot_The_Food15-Jan-07 1:42 
AnswerRe: Assigning the result of an SQL ExecuteScalar() to an int? Pin
Pete O'Hanlon15-Jan-07 1:57
mvePete O'Hanlon15-Jan-07 1:57 
GeneralRe: Assigning the result of an SQL ExecuteScalar() to an int? Pin
aSarafian15-Jan-07 2:30
aSarafian15-Jan-07 2:30 
GeneralRe: Assigning the result of an SQL ExecuteScalar() to an int? Pin
Colin Angus Mackay15-Jan-07 2:48
Colin Angus Mackay15-Jan-07 2:48 
GeneralRe: Assigning the result of an SQL ExecuteScalar() to an int? Pin
aSarafian15-Jan-07 5:04
aSarafian15-Jan-07 5:04 
Questionregular expressions problem Pin
rafiki27015-Jan-07 1:05
rafiki27015-Jan-07 1:05 
AnswerRe: regular expressions problem Pin
Stefan Troschuetz15-Jan-07 3:07
Stefan Troschuetz15-Jan-07 3:07 
QuestionGeneric Dictionary: Dictionary in a Dictionary? Pin
olethroz15-Jan-07 0:33
olethroz15-Jan-07 0:33 
AnswerRe: Generic Dictionary: Dictionary in a Dictionary? Pin
aSarafian15-Jan-07 1:12
aSarafian15-Jan-07 1:12 
GeneralRe: Generic Dictionary: Dictionary in a Dictionary? Pin
olethroz15-Jan-07 9:03
olethroz15-Jan-07 9:03 
Questionchoose file dialog box Pin
ALAQUNAIBI14-Jan-07 23:18
ALAQUNAIBI14-Jan-07 23:18 

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.