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

C#

 
GeneralRe: ListView in C# Pin
King Julien25-Mar-09 20:49
King Julien25-Mar-09 20:49 
GeneralRe: ListView in C# Pin
mrithula825-Mar-09 21:08
mrithula825-Mar-09 21:08 
GeneralRe: ListView in C# Pin
King Julien25-Mar-09 21:30
King Julien25-Mar-09 21:30 
GeneralRe: ListView in C# Pin
mrithula826-Mar-09 1:08
mrithula826-Mar-09 1:08 
GeneralRe: ListView in C# Pin
King Julien26-Mar-09 1:24
King Julien26-Mar-09 1:24 
GeneralRe: ListView in C# Pin
mrithula826-Mar-09 1:32
mrithula826-Mar-09 1:32 
GeneralRe: ListView in C# Pin
King Julien26-Mar-09 1:56
King Julien26-Mar-09 1:56 
GeneralRe: ListView in C# Pin
mrithula826-Mar-09 5:59
mrithula826-Mar-09 5:59 
Hi I have created 3 column headers
private void CreateHeadersAndFillListView()
       {
           colHead = new ColumnHeader();
           colHead.Text = "Servers";
           colHead.Width = 250;
           listView1.Columns.Add(colHead);

           colHead = new ColumnHeader();
           colHead.Text = "Status";
           colHead.Width = 100;
           listView1.Columns.Add(colHead);

           colHead = new ColumnHeader();
           colHead.Text = "Last accessed";
           colHead.Width = 100;
           listView1.Columns.Add(colHead);


       }

       private void PaintList(String sss)
       {
           try
           {

               //ListViewItem.ListViewSubItem lvsi;
               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 = listBox4.SelectedItem.ToString();
                           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)
                               {
                                   DirectoryInfo di = new DirectoryInfo(foldername);
                                   if (di.Exists)
                                   {
                                       String[] files;
                                       files = Directory.GetFiles(foldername,"*.exe*");

                                       foreach (String filename in files)
                                       {
                                           lvi = new ListViewItem();
                                           lvi.Text = filename;
                                           listView1.Items.Add(lvi);
                                       }
                                       this.Controls.Add(listView1);
                                   }
                               }
                           }
                           break;
                   }
               }
           }
           catch (System.Exception err)
           {
               MessageBox.Show("Error: " + err.Message);
           }
       }

private void Start_Click(object sender, EventArgs e)
       {

           String n2, n1, n3, n4;
           n1 = lb4.Text;
           n2 = lb5.Text;
           n3 = lb6.Text;
           n4 = lb7.Text;
           ProcessStartInfo si1;
           if (cb.Checked)
           {
               n1 = lb4.Text;
               // System.Diagnostics.Process.Start(n1);
               si1 = new ProcessStartInfo(n1);
               proc = Process.Start(si1);
               proclist.Add(proc);


           }

           if (cb1.Checked)
           {
               n2 = lb5.Text;
               //System.Diagnostics.Process.Start(n2);
               ProcessStartInfo si2 = new ProcessStartInfo(n2);
               proc = Process.Start(si2);
               proclist.Add(proc);

           }  foreach(Process pr in proclist)
           {
               ListViewItem.ListViewSubItem lvsi = new ListViewItem.ListViewSubItem();
               lvsi.
               lvsi.Text = "Started..";
               lvi.SubItems.Add(lvsi);

           }

GeneralRe: ListView in C# Pin
mrithula826-Mar-09 19:00
mrithula826-Mar-09 19:00 
GeneralRe: ListView in C# Pin
King Julien26-Mar-09 19:22
King Julien26-Mar-09 19:22 
GeneralRe: ListView in C# Pin
mrithula829-Mar-09 0:51
mrithula829-Mar-09 0:51 
AnswerRe: ListView in C# [modified] Pin
Xmen Real 24-Mar-09 20:35
professional Xmen Real 24-Mar-09 20:35 
QuestionRe: ListView in C# Pin
0x3c024-Mar-09 21:08
0x3c024-Mar-09 21:08 
AnswerRe: ListView in C# Pin
Xmen Real 24-Mar-09 21:12
professional Xmen Real 24-Mar-09 21:12 
QuestionI have this error (Specified cast is not valid.) Pin
malkan Rahim Nazari24-Mar-09 19:45
malkan Rahim Nazari24-Mar-09 19:45 
AnswerRe: I have this error (Specified cast is not valid.) Pin
Christian Graus24-Mar-09 20:26
protectorChristian Graus24-Mar-09 20:26 
GeneralRe: I have this error (Specified cast is not valid.) [modified] Pin
malkan Rahim Nazari24-Mar-09 22:26
malkan Rahim Nazari24-Mar-09 22:26 
GeneralRe: I have this error (Specified cast is not valid.) Pin
Luc Pattyn25-Mar-09 3:21
sitebuilderLuc Pattyn25-Mar-09 3:21 
QuestionProblem with connecting windows service through sockets Pin
lnmca24-Mar-09 18:54
lnmca24-Mar-09 18:54 
AnswerRe: Problem with connecting windows service through sockets Pin
Nicholas Butler25-Mar-09 0:00
sitebuilderNicholas Butler25-Mar-09 0:00 
GeneralRe: Problem with connecting windows service through sockets Pin
lnmca25-Mar-09 2:56
lnmca25-Mar-09 2:56 
QuestionError with nhunspell Pin
sagun shrestha24-Mar-09 18:48
sagun shrestha24-Mar-09 18:48 
AnswerRe: Error with nhunspell Pin
Ashfield24-Mar-09 22:15
Ashfield24-Mar-09 22:15 
QuestionHelp me!!with C# Please Pin
hoale200824-Mar-09 18:43
hoale200824-Mar-09 18:43 
GeneralRe: Help me!!with C# Please Pin
King Julien24-Mar-09 19:49
King Julien24-Mar-09 19:49 

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.