00001 using System;
00002 using System.Collections;
00003
00004 namespace sharpSshTest.sharpssh_samples
00005 {
00009 public class Util
00010 {
00014 public static SshConnectionInfo GetInput()
00015 {
00016 SshConnectionInfo info = new SshConnectionInfo();
00017 Console.Write("Enter Remote Host: ");
00018 info.Host = Console.ReadLine();
00019 Console.Write("Enter Username: ");
00020 info.User = Console.ReadLine();
00021
00022 Console.Write("Use publickey authentication? [Yes|No] :");
00023 string resp = Console.ReadLine();
00024 if(resp.ToLower().StartsWith("y"))
00025 {
00026 Console.Write("Enter identity key filename: ");
00027 info.IdentityFile = Console.ReadLine();
00028 }
00029 else
00030 {
00031 Console.Write("Enter Password: ");
00032 info.Pass = Console.ReadLine();
00033 }
00034 Console.WriteLine();
00035 return info;
00036 }
00037 }
00038
00039 public struct SshConnectionInfo
00040 {
00041 public string Host;
00042 public string User;
00043 public string Pass;
00044 public string IdentityFile;
00045 }
00046 }