- Timestamp:
- Dec 24, 2015, 10:43:43 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocumentManager.cs
r1474 r1728 36 36 37 37 //Connection variables (tied to command line parameters /a /v /s /p /e) 38 //New variables for ssh 38 39 private string m_AccessCode=""; 39 40 private string m_VerifyCode=""; 40 41 private string m_Server=""; 42 private string m_SshUser = ""; 43 private string m_SshPassword = ""; 41 44 private int m_Port=0; 42 45 private string m_Encoding=""; //Encoding is "" by default; 46 public Process m_SsshProcess; 43 47 44 48 //Globalization Object (tied to command line parameter /culture) … … 212 216 { "v=", v => _current.m_VerifyCode = v }, 213 217 { "e=", e => _current.m_Encoding = e}, 218 { "su=",su => _current.m_SshUser = su }, 219 { "sp=",sp => _current.m_SshPassword = sp }, 214 220 { "culture=", culture => _current.m_CultureName = culture } 215 221 }; … … 377 383 LoginProcess login; 378 384 this.WinFramework = WinFramework.CreateWithNetworkBroker(true, RPCLogger); 385 386 if (m_SshUser != "") 387 { 388 string path = System.IO.Directory.GetCurrentDirectory(); 389 path = path.Substring(0, path.LastIndexOf('\\')); 390 //path = path.Substring(0, path.LastIndexOf('\\')); 391 path = path + '\\' + "Putty\\putty.exe"; 392 if (System.IO.File.Exists(path)) 393 { 394 string prms = "-ssh -l " + m_SshUser + " -pw " + m_SshPassword + " -L " + m_Port + ":127.0.0.1:" + m_Port + " " + m_Server; 395 //m_SsshProcess = System.Diagnostics.Process.Start(path, prms); 396 ProcessStartInfo si = new ProcessStartInfo(path, prms); 397 si.WindowStyle = ProcessWindowStyle.Minimized; 398 m_SsshProcess = Process.Start(si); 399 } 400 } 379 401 380 402 if (bReLogin) // if logging in again... … … 410 432 spec.Port = m_Port; 411 433 spec.Server = m_Server; 434 if (m_SsshProcess != null) 435 { 436 spec.Server = "127.0.0.1"; 437 } 412 438 spec.UseWindowsAuthentication = false; //for now 413 439 spec.UseDefaultNamespace = true; //for now … … 444 470 if (!login.WasSuccessful) 445 471 { 472 if (m_SsshProcess != null) 473 { 474 if (!m_SsshProcess.HasExited) 475 { 476 m_SsshProcess.Kill(); 477 } 478 } 446 479 return false; 447 480 } … … 451 484 if ((this.WinFramework.Context.User.Division == null) && !this.WinFramework.AttemptUserInputSetDivision("Set Initial Division", firstSplash)) 452 485 { 486 if (m_SsshProcess != null) 487 { 488 if (!m_SsshProcess.HasExited) 489 { 490 m_SsshProcess.Kill(); 491 } 492 } 453 493 return false; 454 494 } … … 650 690 "Version Mismatch"); 651 691 closeSplashDelegate(); 692 if (m_SsshProcess != null) 693 { 694 if (!m_SsshProcess.HasExited) 695 { 696 m_SsshProcess.Kill(); 697 } 698 } 652 699 return false; 653 700 }
Note:
See TracChangeset
for help on using the changeset viewer.