Passing data to a Process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chinu
    New Member
    • Jun 2007
    • 36

    #1

    Passing data to a Process

    Lets say I have a console application in C#. I want to start a new process, "devenv" and open a file, "helloworld.cs" . This much is fine. But what if I want to pass some data, lets say before starting the process, I have an int with value 100 and when the helloworld.cs opens, it should point to the 100th line...any idea????
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    You want the code to start executing on the 100th line??

    You can send arguments to the process (just like you would on the command line)
    You can also grab control of the Standard In/Out/Error streams of a process you start.

    Comment

    • chinu
      New Member
      • Jun 2007
      • 36

      #3
      Originally posted by Plater
      You want the code to start executing on the 100th line??

      You can send arguments to the process (just like you would on the command line)
      You can also grab control of the Standard In/Out/Error streams of a process you start.
      No i want the focus of the cursor to be on the 100th line

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        What process are you starting?
        If it's one of your own creation you can add that functionality in.

        If you're starting like say notepad, you might have to do a DLLImport and use SendKeys to send like the down arrow key 100 times or something

        Comment

        • chinu
          New Member
          • Jun 2007
          • 36

          #5
          Originally posted by Plater
          What process are you starting?
          If it's one of your own creation you can add that functionality in.

          If you're starting like say notepad, you might have to do a DLLImport and use SendKeys to send like the down arrow key 100 times or something
          I am starting devenv. Lets say when i click a button in my windows forms, i have a value 10 and i will open a .cs file in the devenv using Process.Start() ..
          but my question is how to pass that 10 to the devenv so that it can focus to the 10th line in the .cs file which is opened.

          Comment

          Working...