can i use process.Start() and process.WaitForExit() ?

3 posts, 0 answers
  1. Basel
    Basel avatar
    2 posts
    Member since:
    Feb 2014

    Posted 12 Mar 2014 Link to this post

    can i use process.Start() and process.WaitForExit() ?
    i need to create log with external program
    now i want to use process.start to start the program and process.WaitForExit to wait for the program
  2. Basel
    Basel avatar
    2 posts
    Member since:
    Feb 2014

    Posted 12 Mar 2014 in reply to Basel Link to this post

    and i wate to use this in fiddler script
  3. Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 12 Mar 2014 Link to this post

    FiddlerScript can call nearly any method in the .NET Framework. Beyond that, Fiddler itself exposes a method that you can use for this, from FiddlerScript or an extension:

    Utilities.RunExecutableAndWait("C:\\temp\\myapp.exe", "myparameter1 myparameter2");

    Please do keep in mind that this is a blocking call, so if you call it from a session-processing callback like OnBeforeRequest or OnBeforeResponse, that session will be blocked until the executable exits. If you call it from a UI-processing callback (e.g. a ToolsAction handler or the like) it will block the UI until the executable exits.

    Depending on your needs, you may want to keep a log "in memory" and only flush it to disk from time to time. Or you could write an Exporter that would show up inside File > Export Sessions.

Back to Top