Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Test_Form
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         private static string[][] useraccs = {
  15.             new string[] {"abc", "1234"},
  16.             new string[] {"def", "1234"}
  17.         };
  18.  
  19.         public Form1()
  20.         {
  21.             InitializeComponent();
  22.  
  23.             List<Host> hosts = Host.GetAllHost();
  24.             string username = "";
  25.             string password = "";
  26.  
  27.             foreach (Host host in hosts)
  28.             {
  29.                 bool found = false;
  30.                 for (int i = 0; i < useraccs.Length && !found; i++)
  31.                 {
  32.                     Manager mgn = new Manager(host.host, useraccs[i][0], useraccs[i][0]);
  33.                     if (mgn.isConnected)
  34.                     {
  35.                         found = true;
  36.                     }
  37.                 }
  38.             }
  39.  
  40.             /*
  41.             List<ManagerDataRow> mgnRows = new List<ManagerDataRow>();
  42.             foreach (Host host in hosts)
  43.             {
  44.                 Manager mgn = new Manager(host.host, username, password);
  45.                 ManagerDataRow mdr = new ManagerDataRow(mgn);
  46.                 mgnRows.Add(mdr);
  47.             }
  48.  
  49.             // Add row to the Grid
  50.             srvInfoGrid.DataSource = mgnRows;
  51.             */
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement