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????
Passing data to a Process
Collapse
X
-
No i want the focus of the cursor to be on the 100th lineOriginally posted by PlaterYou 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
-
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() ..Originally posted by PlaterWhat 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
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
Comment