Click here to Skip to main content
15,889,867 members
Home / Discussions / C#
   

C#

 
AnswerRe: 2d graphs in c# Pin
Megidolaon23-Feb-09 20:16
Megidolaon23-Feb-09 20:16 
AnswerRe: 2d graphs in c# Pin
Nagy Vilmos23-Feb-09 22:55
professionalNagy Vilmos23-Feb-09 22:55 
QuestionHello, please help me cusutomize datagrid or datagridview in C# Pin
anhdn200823-Feb-09 19:52
anhdn200823-Feb-09 19:52 
QuestionType cast Pin
mrithula823-Feb-09 17:58
mrithula823-Feb-09 17:58 
AnswerRe: Type cast Pin
Eslam Afifi23-Feb-09 18:19
Eslam Afifi23-Feb-09 18:19 
GeneralRe: Type cast Pin
mrithula823-Feb-09 18:34
mrithula823-Feb-09 18:34 
AnswerRe: Type cast Pin
Cracked-Down23-Feb-09 18:52
Cracked-Down23-Feb-09 18:52 
GeneralRe: Type cast Pin
mrithula823-Feb-09 19:03
mrithula823-Feb-09 19:03 
Hi I want to list all the folders in any drives and then the files
in each folder in a listbox control
I am able to list all the folders...
I tried with the following code to list the files in the folder
The folder contains 10 files but this code lists only 1 file from
that folder...The last foreach does not work properly...
What changes should i make?
private void ShowPath_Click(object sender, EventArgs e)
       {
           reader = new XmlTextReader("path.xml");
           Form1 f = new Form1();
           String sp="";
           String[] gi;
          // String[] pie;
           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 = listBox1.SelectedItem.ToString();
                       String sss = ss + s1;
                       object o3 = (object)sss;
                       //String s = (string)o3;
                      // listBox2.Items.Add(o3);

                      DirectoryInfo dire = new DirectoryInfo(sss);
                       if (dire.Exists)
                       {
                           String[] folder;
                           folder = Directory.GetDirectories(sss);
                           foreach (string foldername in folder)
                           {
                               FileInfo fil = new FileInfo(foldername);
                            //   listBox2.Items.Add(fil.ToString());

                               sp = fil.ToString();
                              // listBox2.Items.Add(sp);

                           }
                       }
                           gi = new String[] { sp };

                           foreach(String pil in gi)
                           {

                               DirectoryInfo di = new DirectoryInfo(pil);
                               if (di.Exists)
                               {
                                   String[] files;
                                   files = Directory.GetFiles(pil);
                                   foreach (String filename in files)
                                   {
                                       FileInfo fil2 = new FileInfo(filename);
                                       listBox2.Items.Add(fil2.ToString());
                                   }
                               }
                           }

                       break;

               }
           }
       }

AnswerRe: Type cast Pin
Cracked-Down23-Feb-09 19:10
Cracked-Down23-Feb-09 19:10 
GeneralRe: Type cast Pin
mrithula823-Feb-09 20:02
mrithula823-Feb-09 20:02 
AnswerRe: Type cast Pin
Cracked-Down23-Feb-09 20:16
Cracked-Down23-Feb-09 20:16 
GeneralRe: Type cast Pin
mrithula823-Feb-09 23:40
mrithula823-Feb-09 23:40 
AnswerRe: Type cast Pin
Cracked-Down24-Feb-09 0:13
Cracked-Down24-Feb-09 0:13 
QuestionC# NTier and LINQ Pin
Illegal Operation23-Feb-09 14:31
Illegal Operation23-Feb-09 14:31 
AnswerRe: C# NTier and LINQ Pin
Christian Graus23-Feb-09 14:36
protectorChristian Graus23-Feb-09 14:36 
QuestionSimple, but how can I list flies in a dropdown? Pin
KnotBeer23-Feb-09 9:28
KnotBeer23-Feb-09 9:28 
AnswerRe: Simple, but how can I list flies in a dropdown? Pin
Christian Graus23-Feb-09 9:35
protectorChristian Graus23-Feb-09 9:35 
GeneralRe: Simple, but how can I list flies in a dropdown? Pin
KnotBeer23-Feb-09 9:40
KnotBeer23-Feb-09 9:40 
GeneralRe: Simple, but how can I list flies in a dropdown? Pin
Luc Pattyn23-Feb-09 10:28
sitebuilderLuc Pattyn23-Feb-09 10:28 
AnswerRe: Simple, but how can I list flies in a dropdown? Pin
pdohara23-Feb-09 11:08
pdohara23-Feb-09 11:08 
QuestionLINQ / DataGrid / Databinding Pin
honkman23-Feb-09 8:59
honkman23-Feb-09 8:59 
AnswerRe: LINQ / DataGrid / Databinding Pin
Judah Gabriel Himango23-Feb-09 11:45
sponsorJudah Gabriel Himango23-Feb-09 11:45 
Questionusing System.Threading.Tasks; Pin
TerRO_GirL23-Feb-09 8:44
TerRO_GirL23-Feb-09 8:44 
AnswerRe: using System.Threading.Tasks; Pin
Dave Kreskowiak23-Feb-09 9:07
mveDave Kreskowiak23-Feb-09 9:07 
GeneralRe: using System.Threading.Tasks; Pin
TerRO_GirL23-Feb-09 9:13
TerRO_GirL23-Feb-09 9:13 

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.