Click here to Skip to main content
15,895,812 members
Home / Discussions / C#
   

C#

 
QuestionGetting data from a web page Pin
nike_arh29-Mar-09 4:07
nike_arh29-Mar-09 4:07 
AnswerRe: Getting data from a web page Pin
Xmen Real 29-Mar-09 4:26
professional Xmen Real 29-Mar-09 4:26 
QuestionTreeView Nodes Pin
Mohammed Elkholy29-Mar-09 3:50
Mohammed Elkholy29-Mar-09 3:50 
AnswerRe: TreeView Nodes Pin
Xmen Real 29-Mar-09 4:18
professional Xmen Real 29-Mar-09 4:18 
GeneralRe: TreeView Nodes Pin
Mohammed Elkholy29-Mar-09 4:30
Mohammed Elkholy29-Mar-09 4:30 
GeneralRe: TreeView Nodes Pin
Pete O'Hanlon29-Mar-09 10:29
mvePete O'Hanlon29-Mar-09 10:29 
GeneralRe: TreeView Nodes Pin
Henry Minute29-Mar-09 12:05
Henry Minute29-Mar-09 12:05 
QuestionList index in C# Pin
mrithula829-Mar-09 3:09
mrithula829-Mar-09 3:09 
Hi I want to list folders,subfolders and files from all drives in a system.I tried a code which works well for C:\.I want the same for the other drives.I have listed the drives in listbox.Please give your suggestions.
private void PaintList(String sss)
        {

            try
                {
                    reader = new XmlTextReader("path.xml");

                    while (reader.Read())
                    {
                        switch (reader.NodeType)
                        {
                            case XmlNodeType.Text: //Display the text in each element.
                                //   Console.WriteLine(reader.Value);
                                String s1;
                                s1 = reader.Value;
                                String ss;
                                ss = listBox1.SelectedItem.ToString();
                                sss = ss + s1;
                                object o3 = (object)sss;

                                DirectoryInfo dire = new DirectoryInfo(sss);

                                //DirectoryInfo[] dirs = dire.GetDirectories();

                                if (dire.Exists)
                                {
                                    String[] folder;
                                    folder = Directory.GetDirectories(sss);
                                    foreach (string foldername in folder)
                                    {
                                        DirectoryInfo di = new DirectoryInfo(foldername);
                                        if (di.Exists)
                                        {
                                            String[] files;
                                            files = Directory.GetFiles(foldername, "*.exe*");

                                            //FileInfo[] fi = dire.GetFiles();

                                            foreach (String filename in files)
                                            {
                                                lvi = new ListViewItem();
                                                lvi.Text = filename;
                                                listView1.Items.Add(lvi);

                                                lvsi = new ListViewItem.ListViewSubItem();
                                                lvsi.Text = filename.Length.ToString();
                                                lvi.SubItems.Add(lvsi);
                                                //listView1.Items[0].SubItems.Insert(1, lvsi);                                           


                                            }

                                            

                                            this.Controls.Add(listView1);
                                        }
                                    }
                                }
                                break;
                        }
                    }
                }
                catch (System.Exception err)
                {
                    MessageBox.Show("Error: " + err.Message);
                }
            
        }

AnswerRe: List index in C# Pin
Xmen Real 29-Mar-09 4:20
professional Xmen Real 29-Mar-09 4:20 
GeneralRe: List index in C# Pin
mrithula829-Mar-09 20:27
mrithula829-Mar-09 20:27 
GeneralRe: List index in C# Pin
Xmen Real 29-Mar-09 21:47
professional Xmen Real 29-Mar-09 21:47 
QuestionOnly MySqlParameter objects may be stored Pin
naim khan29-Mar-09 2:07
naim khan29-Mar-09 2:07 
AnswerRe: Only MySqlParameter objects may be stored Pin
Xmen Real 29-Mar-09 4:09
professional Xmen Real 29-Mar-09 4:09 
AnswerRe: Only MySqlParameter objects may be stored Pin
PIEBALDconsult29-Mar-09 4:57
mvePIEBALDconsult29-Mar-09 4:57 
QuestionList of classes and namespaces in .Net Framework ? [modified] Pin
Mohammad Dayyan29-Mar-09 1:41
Mohammad Dayyan29-Mar-09 1:41 
AnswerRe: List of classes and namespaces in .Net Framework ? Pin
Eddy Vluggen29-Mar-09 2:31
professionalEddy Vluggen29-Mar-09 2:31 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
Mohammad Dayyan29-Mar-09 2:38
Mohammad Dayyan29-Mar-09 2:38 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
Eddy Vluggen29-Mar-09 2:44
professionalEddy Vluggen29-Mar-09 2:44 
AnswerRe: List of classes and namespaces in .Net Framework ? Pin
Giorgi Dalakishvili29-Mar-09 2:35
mentorGiorgi Dalakishvili29-Mar-09 2:35 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
Mohammad Dayyan29-Mar-09 2:50
Mohammad Dayyan29-Mar-09 2:50 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
PIEBALDconsult29-Mar-09 5:05
mvePIEBALDconsult29-Mar-09 5:05 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
Mohammad Dayyan29-Mar-09 5:08
Mohammad Dayyan29-Mar-09 5:08 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
Mohammad Dayyan29-Mar-09 6:01
Mohammad Dayyan29-Mar-09 6:01 
GeneralRe: List of classes and namespaces in .Net Framework ? Pin
Giorgi Dalakishvili29-Mar-09 6:48
mentorGiorgi Dalakishvili29-Mar-09 6:48 
QuestionHow to transfer text to label from richtextbox Pin
Sokka9329-Mar-09 1:35
Sokka9329-Mar-09 1:35 

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.