/////////////////////////////////////////////////////////////////////////////// // File: login.cs // // Contents: // A sample script that automatically logs in to a remote UNIX system by: // Prompting user for a Hostname // Prompting user for a Username // Prompting user for a Password // Then connects to the system. // // Originated by J. Beutler, Century Software 1/28/99 /////////////////////////////////////////////////////////////////////////////// // Initialize variables, then prompts user for values var node = te.Read("Hostname > ", true); var name = te.Read("Username > ", true); var pass = te.Read("Password > ", false); te.displaynl(""); te.netport = 23; // Sets node = "Hostname" te.Node=node; te.ConnectionType = 0; te.displaynl(""); // Sets Emulation Type te.Emulation = _val(te.Read("Emulation(VT100 = 10, SCOANSI = 5, WYSE60 = 17)> ", true)); // Turns autologin off in the login scheme. te.Autologin=0; // Connects to host te.Connect(); // Waits for prompts from the host system, then sends the username/password. if (te.Wait("ogin:",5) != -1 ) { te.Xmit(name + "\r\n"); } te.Wait("assword:",5); te.Xmit(pass + "\r\n");