Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string ip = project.Variables["ip"].Value;
- string user = project.Variables["user"].Value;
- string passadmin = project.Variables["passadmin"].Value;
- string cnt_akk = project.Variables["cnt_akk"].Value;
- string token = project.Variables["token"].Value;
- string title = project.Variables["title"].Value;
- SshClient sshClient = new SshClient(ip, 22, user, passadmin);
- sshClient.Connect();
- project.SendInfoToLog("Соединились с сервером", true);
- var cmd = sshClient.CreateCommand("cd /root/upload/");
- cmd.Execute();
- project.SendInfoToLog("Зашли в папку", true);
- project.SendInfoToLog("Начинаем танцы с бубмном после execute", true);
- IDictionary<Renci.SshNet.Common.TerminalModes, uint> termkvp = new Dictionary<Renci.SshNet.Common.TerminalModes, uint>();
- termkvp.Add(Renci.SshNet.Common.TerminalModes.ECHO, 53);
- ShellStream shellStream = sshClient.CreateShellStream("xterm", 80,24, 800, 600, 1024, termkvp);
- shellStream.WriteLine("drive -c /root/upload/account"+cnt_akk+"/ upload -f keygen.pdf -t "+title);
- project.SendInfoToLog("Отправили drive", true);
- shellStream.WriteLine(token);
- project.SendInfoToLog("Отправили токен", true);
- shellStream.Expect(new Regex(@"enter"), new TimeSpan(0, 15, 0));
- sshClient.Disconnect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement