I need to do the following things:
1) Сonnect to the server 2) Run the application E:\backup\backup.exe 3) copy E:\backup\log.txt in E:\backup\history\ 18.11.16 20-54-32.txt where the file name will be changed to the current time. 4) Disconnect from the server.
Tell me please, possible to do this the following on C #? And if its possible - preferably example or link to the necessary. Thanks.
using System;
//using Cassia;
using MSTSCLib;
namespace rdm
{
class Program
{
static void Main(string[] args)
{
var rdp = new MsRdpClient8NotSafeForScripting();
rdp.Server= "192.168.0.101"; //adress
rdp.Domain = "localdomain"; //domain
rdp.UserName = "test"; //login
rdp.AdvancedSettings8.ClearTextPassword = "123456";//password
try
{
rdp.Connect();
}
catch(Exception e)
{
Console.WriteLine(e);
}
Console.WriteLine(rdp.Connected);
if (rdp.Connected != 0)
{
rdp.Disconnect();
}
Console.ReadKey(true);
}
}
}