Guest User

Untitled

a guest
Jan 15th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. AndroidSmS aHelper = new AndroidSmS();
  2. string renameMsg = aHelper.RenameFile();
  3.  
  4. public string RenameFile() {
  5.  
  6. string renameBATPath = ConfigurationManager.AppSettings["RenameBATPath"].ToString();
  7. string o;
  8. string str = DateTime.Now.ToOADate().ToString();
  9. using (var p = new System.Diagnostics.Process())
  10. {
  11. p.StartInfo.UseShellExecute = false;
  12. p.StartInfo.RedirectStandardOutput = true;
  13. p.StartInfo.FileName = @renameBATPath;
  14. p.StartInfo.Arguments = DateTime.Now.ToShortDateString().ToString().Replace('/', '-')+".db";
  15. p.Start();
  16. o = p.StandardOutput.ReadToEnd();
  17. p.WaitForExit();
  18. }
  19. return o;
  20.  
  21. }
  22.  
  23. p.StartInfo.UseShellExecute = false;
  24. p.StartInfo.RedirectStandardOutput = true;
  25. p.StartInfo.FileName = @renameBATPath;
  26. p.StartInfo.Arguments = DateTime.Now.ToShortDateString().ToString().Replace('/', '-')+".db";
  27. p.StartInfo.UserName = "administrator";
  28. char[] password = { 'p', 'a', 's', 's', 'w', 'o', 'r', 'd' };
  29. SecureString adminpassword = new SecureString();
  30. foreach (char c in password)
  31. {
  32. adminpassword.AppendChar(c);
  33. }
  34. p.StartInfo.Password = adminpassword;
  35. p.Start();
Add Comment
Please, Sign In to add comment