Advertisement
tankcr

remoteapp

Jun 3rd, 2014
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.48 KB | None | 0 0
  1. {
  2.  
  3.     public class RemoteApps
  4.     {
  5.         string remoteApp;
  6.         public string RemoteApp
  7.         {
  8.             get { return remoteApp; }
  9.             set { remoteApp = value; }
  10.         }
  11.     }
  12.     public class remoteApp
  13.     {
  14.         public static string GetApp(string appname, string computername)
  15.         {
  16.             RemoteApps App = new RemoteApps();
  17.             App.RemoteApp = appname;
  18.            
  19. /*            Process p = new Process();
  20.             p.StartInfo.UseShellExecute = false;
  21.             p.StartInfo.RedirectStandardOutput = true;
  22.             p.StartInfo.RedirectStandardError = true;
  23.             p.StartInfo.RedirectStandardInput = true;
  24.             p.StartInfo.FileName = @"./PsExec.exe";
  25.             p.StartInfo.Arguments = @"\\computername cmd.exe ipconfig /all";
  26.             p.Start();
  27.             string output = p.StandardOutput.ReadToEnd();
  28.             string errormessage = p.StandardError.ReadToEnd();
  29.             p.WaitForExit();
  30.             /*var processToRun = new[] {appname};
  31.             var connection = new ConnectionOptions();
  32.             var wmiScope = new ManagementScope(String.Format("\\\\{0}\\root\\cimv2", computername), connection);
  33.             var wmiProcess = new ManagementClass(wmiScope, new ManagementPath("Win32_Process"), new ObjectGetOptions());
  34.             wmiProcess.InvokeMethod("Create", processToRun);
  35. */
  36.             Term term = new Term();
  37.             term.Show();
  38.             return appname;
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement