Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. protected override async Task
  2. OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext,
  3. CancellationToken cancellationToken)
  4. {
  5. await turnContext.SendActivityAsync(MessageFactory.Text($"Echo:
  6. Opening app1..."), cancellationToken);
  7.  
  8. var startInfo = new ProcessStartInfo
  9. {
  10. FileName = @"D:_Projectsxyzapp1.exe",
  11. UseShellExecute = false,
  12. CreateNoWindow = false,
  13. };
  14.  
  15. var process = Process.Start(startInfo);
  16. var success = process != null && process.WaitForExit(30 * 10000);
  17.  
  18. if (!success)
  19. {
  20. //process?.Kill();
  21. throw new ApplicationException("A timeout occurred during
  22. method execution. The service interface did not finish in a
  23. timely fashion.");
  24. }
  25. var exitCode = process.ExitCode;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement