TelnetConnection tc = null;//Instancia vacía TELNET #endregion Variables_Instancias #region MétodoObtenerIP public void ObtenerIP(String Name) { if (tc == null) { tc = new TelnetConnection(Name); string s = tc.Login(US, PW, 100); String c = s.TrimEnd(); c = s.Substring(c.Length - 1, 1); if (c != "$" && c != ">") { tc.TelnetClose(); } } }
public void Close() { tc.TelnetClose(); tc = null; }