日期:2014-05-17 浏览次数:21807 次
private void tray_Init()
{
Ping pg = new Ping();
TelnetClient tc = new TelnetClient();
int num = Convert.ToInt32(ConfigurationSettings.AppSettings["IPAndPortNum"]);
//lock (obj)
//{
int num0 = 0;
int num1 = 0;
for (int i = 0; i < num; i++)
{
string sectionid = "IPAndPort" + i.ToString();
string sectioninfo = ConfigurationSettings.AppSettings[sectionid];
string[] sArray = sectioninfo.Split('#');
string sectionname = sArray[0].ToString();
string sectionIP = sArray[1].ToString();
string sectionPort = sArray[2].ToString();
string sectiontype = sArray[3].ToString();
string imgpathok = Environment.CurrentDirectory.Replace("\\bin\\Debug", "") + "\\img\\blue.jpg";
string imgpathnotok = Environment.CurrentDirectory.Replace("\\bin\\Debug", "") + "\\img\\icon.ico";
PingReply pr = pg.Send(sectionIP);
switch (sectiontype)
{
case "0":
Label lblcontrol = (Label)flp.Controls[2 * i];