Click here to Skip to main content
15,884,739 members
Home / Discussions / C#
   

C#

 
QuestionRe: How to check if extensions follows up in a list? Pin
Goobashi11-Mar-09 23:34
Goobashi11-Mar-09 23:34 
AnswerRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz11-Mar-09 23:40
Matjaz-xyz11-Mar-09 23:40 
QuestionRe: How to check if extensions follows up in a list? Pin
Goobashi11-Mar-09 23:39
Goobashi11-Mar-09 23:39 
AnswerRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:11
professional dan!sh 12-Mar-09 0:11 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:20
Matjaz-xyz12-Mar-09 0:20 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:26
professional dan!sh 12-Mar-09 0:26 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:36
Matjaz-xyz12-Mar-09 0:36 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 1:44
Matjaz-xyz12-Mar-09 1:44 
Somehow it seems i didnt implent this correctly... or it doesnt work right (like you said, it could and could not work)...

aah :/

if (fbd1.ShowDialog() != DialogResult.Cancel)
            {
                if (checkBox1.Checked == true)
                    DIRI.Items.AddRange(Directory.GetDirectories(fbd1.SelectedPath, "*.*", SearchOption.AllDirectories));
                else
                    DIRI.Items.AddRange(Directory.GetDirectories(fbd1.SelectedPath, "*.*", SearchOption.TopDirectoryOnly));


                for (int i = 0; i < DIRI.Items.Count; i++)
                {
                    ArrayList DATOTEKE = new ArrayList();
                    DATOTEKE.AddRange(Directory.GetFiles(DIRI.Items[i].ToString().ToLower()));

                    ArrayList KONCNICE = new ArrayList();

                    for (int bo = 0; bo < DATOTEKE.Count; bo++)
                    {
                        KONCNICE.Add(Path.GetExtension(DATOTEKE[i].ToString()));
                    }



                    bool breakFor = false;
                    int togetherCount = 1;
                    for (int j = 1; j < KONCNICE.Count - 1; i++)
                    {
                        if (KONCNICE[j] == KONCNICE[j - 1])
                        {
                            togetherCount++;
                            continue;
                        }
                        else
                        {
                            int count = 0;
                            while (count < togetherCount)
                            {
                                if (!(KONCNICE[j + 1] == KONCNICE[j + count]))
                                {
                                    if (togetherCount > 1)
                                    {
                                        //if (listBox1.FindStringExact(DIRI.Items[i].ToString()) > 0)
                                            listBox1.Items.Add(DIRI.Items[i].ToString());
                                        breakFor = true;
                                        break;
                                    }
                                }
                                count++;
                            }
                            if (breakFor)
                            {
                                break;
                            }
                            else
                            {
                                j = j + togetherCount;
                                togetherCount = 1;
                            }
                        }
                    }


                }
            }


Regards,
Matjaž

GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 2:21
professional dan!sh 12-Mar-09 2:21 
GeneralRe: How to check if extensions follows up in a list? Pin
Luc Pattyn12-Mar-09 3:33
sitebuilderLuc Pattyn12-Mar-09 3:33 
AnswerRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:14
professional Xmen Real 12-Mar-09 0:14 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:22
Matjaz-xyz12-Mar-09 0:22 
GeneralRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:27
professional Xmen Real 12-Mar-09 0:27 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:30
Matjaz-xyz12-Mar-09 0:30 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:33
professional dan!sh 12-Mar-09 0:33 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:35
Matjaz-xyz12-Mar-09 0:35 
GeneralRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:35
professional Xmen Real 12-Mar-09 0:35 
GeneralRe: How to check if extensions follows up in a list? Pin
Luc Pattyn12-Mar-09 3:44
sitebuilderLuc Pattyn12-Mar-09 3:44 
QuestionWIN directory to DOS directory question Pin
Goobashi11-Mar-09 23:22
Goobashi11-Mar-09 23:22 
AnswerRe: WIN directory to DOS directory question Pin
musefan11-Mar-09 23:44
musefan11-Mar-09 23:44 
GeneralRe: WIN directory to DOS directory question Pin
Goobashi11-Mar-09 23:56
Goobashi11-Mar-09 23:56 
AnswerRe: WIN directory to DOS directory question Pin
Matjaz-xyz12-Mar-09 1:00
Matjaz-xyz12-Mar-09 1:00 
AnswerRe: WIN directory to DOS directory question Pin
0x3c012-Mar-09 1:44
0x3c012-Mar-09 1:44 
QuestionHow to run an expression which is in string format? Pin
RezaAsAdi11-Mar-09 23:08
RezaAsAdi11-Mar-09 23:08 
AnswerRe: How to run an expression which is in string format? Pin
Expert Coming11-Mar-09 23:11
Expert Coming11-Mar-09 23:11 

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.