Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Test_Form
- {
- public partial class Form1 : Form
- {
- private static string[][] useraccs = {
- new string[] {"abc", "1234"},
- new string[] {"def", "1234"}
- };
- public Form1()
- {
- InitializeComponent();
- List<Host> hosts = Host.GetAllHost();
- string username = "";
- string password = "";
- foreach (Host host in hosts)
- {
- bool found = false;
- for (int i = 0; i < useraccs.Length && !found; i++)
- {
- Manager mgn = new Manager(host.host, useraccs[i][0], useraccs[i][0]);
- if (mgn.isConnected)
- {
- found = true;
- }
- }
- }
- /*
- List<ManagerDataRow> mgnRows = new List<ManagerDataRow>();
- foreach (Host host in hosts)
- {
- Manager mgn = new Manager(host.host, username, password);
- ManagerDataRow mdr = new ManagerDataRow(mgn);
- mgnRows.Add(mdr);
- }
- // Add row to the Grid
- srvInfoGrid.DataSource = mgnRows;
- */
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement