コード例 #1
0
ファイル: RemoteSystem.cs プロジェクト: etteyafed/NepConSharp
 public RemoteSystem(RemoteSystem info)
 {
     this.Name = info.GetName ();
     this.Host = info.GetHost ();
     this.GatewayName = info.GetGatewayName ();
     this.IsGateway = info.GetIsGateway ();
     this.User = info.GetUser ();
     this.Port = info.GetPort ();
     this.Protocol = info.GetProtocol ();
     this.AuthType = info.GetAuthType ();
     this.AuthKey = info.GetAuthKey ();
 }
コード例 #2
0
 private System.Diagnostics.ProcessStartInfo SetupCommand(RemoteSystem _remote)
 {
     var command = new System.Diagnostics.ProcessStartInfo ();
     var platform = Config.GetPlatformID ();
     switch (_remote.GetProtocol ())
     {
         case "SSH":
             if (platform == System.PlatformID.Unix)
             {
                 command.FileName = "/usr/bin/xterm";
                 command.Arguments = "-fa lucidatypewriter-14 " +
                     "-fg midnightblue -bg palegoldenrod -geometry 120x40 " +
                     "-e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no " +
                     _remote.GetUser () + "@127.0.0.1 -p" + _remote.GetLPort ().ToString ();
             } else if (platform == System.PlatformID.MacOSX) {
                 // TODO: COMPLETE
             } else if (platform == System.PlatformID.Win32NT) {
                 // TODO: COMPLETE
             }
             break;
         case "RDP":
             if (platform == System.PlatformID.Unix)
             {
                 command.FileName = "/usr/bin/rdesktop";
                 command.Arguments = "-u " + _remote.GetUser () + " -g 1280x1024 127.0.0.1:" + _remote.GetLPort ().ToString ();
             } else if (platform == System.PlatformID.MacOSX) {
                 // TODO: COMPLETE
             } else if (platform == System.PlatformID.Win32NT) {
                 command.FileName = "mstsc.exe";
                 command.Arguments = "/v 127.0.0.1:" + _remote.GetLPort ();
             }
             break;
         case "VNC":
             if (platform == System.PlatformID.Unix)
             {
                 command.FileName = "/usr/bin/vncviewer";
                 command.Arguments = "-encodings tight -quality 6 -compresslevel 6 127.0.0.1::" + _remote.GetLPort ().ToString ();
             } else if (platform == System.PlatformID.MacOSX) {
                 // TODO: COMPLETE
             } else if (platform == System.PlatformID.Win32NT) {
                 command.FileName = "C:\\Program Files\\TightVNC\\tvnviewer.exe";
                 command.Arguments = "127.0.0.1::" + _remote.GetLPort ().ToString ();
             }
             break;
         default:
             command.FileName = "/bin/true";
             command.Arguments = "";
             break;
     }
     return command;
 }