Click here to Skip to main content
15,918,125 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to convert flat files to XML using c# Pin
Dan Neely30-Mar-09 2:43
Dan Neely30-Mar-09 2:43 
QuestionCommandBehavior.SequentialAccess (SqlDataReader) Pin
Jacob Dixon29-Mar-09 14:55
Jacob Dixon29-Mar-09 14:55 
AnswerRe: CommandBehavior.SequentialAccess (SqlDataReader) Pin
N a v a n e e t h29-Mar-09 17:38
N a v a n e e t h29-Mar-09 17:38 
QuestionSql query designer Pin
Dushan12329-Mar-09 14:12
Dushan12329-Mar-09 14:12 
AnswerRe: Sql query designer Pin
Natza Mitzi29-Mar-09 19:42
Natza Mitzi29-Mar-09 19:42 
QuestionWhen Adding A Control, what events fire? [modified] Pin
Duraplex29-Mar-09 13:09
Duraplex29-Mar-09 13:09 
AnswerRe: When Adding A Control, what events fire? Pin
maxatlis30-Mar-09 7:00
maxatlis30-Mar-09 7:00 
GeneralRe: When Adding A Control, what events fire? Pin
Duraplex30-Mar-09 11:47
Duraplex30-Mar-09 11:47 
Question%SystemRoot%\Microsoft.NET\Framework\ Pin
Mohammad Dayyan29-Mar-09 6:49
Mohammad Dayyan29-Mar-09 6:49 
AnswerRe: %SystemRoot%\Microsoft.NET\Framework\ Pin
Giorgi Dalakishvili29-Mar-09 7:00
mentorGiorgi Dalakishvili29-Mar-09 7:00 
GeneralRe: %SystemRoot%\Microsoft.NET\Framework\ PinPopular
PIEBALDconsult29-Mar-09 7:15
mvePIEBALDconsult29-Mar-09 7:15 
GeneralRe: %SystemRoot%\Microsoft.NET\Framework\ Pin
Giorgi Dalakishvili29-Mar-09 7:23
mentorGiorgi Dalakishvili29-Mar-09 7:23 
AnswerRe: %SystemRoot%\Microsoft.NET\Framework\ [modified] Pin
Alan N29-Mar-09 14:07
Alan N29-Mar-09 14:07 
QuestionC# Windows Application problem Pin
cheese_29-Mar-09 5:23
cheese_29-Mar-09 5:23 
AnswerRe: C# Windows Application problem Pin
JF201529-Mar-09 5:41
JF201529-Mar-09 5:41 
AnswerRe: C# Windows Application problem Pin
Luc Pattyn29-Mar-09 6:28
sitebuilderLuc Pattyn29-Mar-09 6:28 
AnswerRe: C# Windows Application problem Pin
BinShao29-Mar-09 15:41
BinShao29-Mar-09 15:41 
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);
                }
            
        }

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.