|
First you have to redirect the StandardOutput:
startInfo.RedirectStandardOutput=true;
Then you can read the output stream just like any test file stream, for example:
String outText = Anima.StandardOuput.ReadToEnd();
RageInTheMachine9532
|
|
|
|
|
Dave thank you,
but that is not my question.
My Question: How do I write in Animation.exe (WinForms-App) to the standard output-stream?
|
|
|
|
|
That is what you asked...
But how can I read the Standard Input in a WinForm?
You can't read the StandardInput. It's a one way pipe for input TO the application you launched. You have to read the StandardOutput to see what the application wrote to the screen.
RageInTheMachine9532
|
|
|
|
|
Yes that's the point: I want change the animation from the parent app.
Ie:
MyApp -> (starts) -> Animation.exe (starts)
later
MyApp -> (command) -> Animation.exe (change picture)
later
MyApp -> (kill) -> Animation.exe (ends)
I tought, I can use a Standard IO-Pipe to command Animation.exe to change it's picture. But I do not know, how to receive the command in Animation.exe
|
|
|
|
|
???????????????????????????????????????????????
???????????????????????????????????????????????
???????????????????????????????????????????????
I take it Animation.exe is a commandline utility that runs in a CMD window? Correct?
If Animation.exe is a normal Windows app (GUI interface), then this won't work...
You can "talk" to Animation.exe through the Standard pipes. StandardInput is the keyboard stream into Animation.exe and StandardOutput is the console stream that the app uses to display text. If you redirect both of these streams in the ProcessStart class you used, you can read and write to the streams using .StardardInput.WriteLine() and .StandardOutput.ReadLine() on the process object that is returned. The catch is, if you redirect the streams, the user won't see anything except a blank console window. No text will be displayed and the window won't respond to the keyboard. Your app will have to send keyboard input using .WriteLine() just like the user would type at the keyboard. If the user has to type EXIT to get the app to quit, your app would have to do something like p.StandardInput.WriteLine("EXIT") to do the same.
RageInTheMachine9532
|
|
|
|
|
>>If Animation.exe is a normal Windows app (GUI interface), then this won't work...
<<
That's the point. But how to talk to Animation.exe?
|
|
|
|
|
Your up a creek without a paddle now...
Unless Animation.exe exposes a COM interface you can use...
You could use SendKeys to send key strokes to Animate.exe, but you'll find it's a problematic solution. Animation.exe must support keyboard shortcuts (like Alt-F for selecting the File menu) and the user CANNOT click ANYWHERE during the operation where you are posting keystrokes. The user can click on something or the system can open another window that snatches the input focus while your posting keystrokes and the target app is process them. If the focus changes, your keystrokes will end up going somewhere you didn't want them to.
Other than that, your options get exceedingly complicated.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
Other than that, your options get exceedingly complicated.
Ups!
Now I know, why I did not find any hints in the helpfiles.
Ok, then I go back and call my pictures with different args in several started processes.
Thank you Dave!
Ariadne
|
|
|
|
|
I have a doubt.in remoting if you want to pass an object(in binary format) .then how it goes to the remote machine and what exactly happens internally.and how the remote machine keep track of the object.
rgds
devkalyan
|
|
|
|
|
These kinds of questions are best answered in .NET Remoting books like "Microsoft .NET Remoting[^]" from MS Press and "Advanced .NET Remoting[^]" from Ingo Rammer.
There is a chain of sinks where the object gets serialized using a formatter (like a BinaryFormatter , then through any optional sinks to the transport sink (like that for a TcpChannel ) which sends it across the wire. The other side does things in the exact opposite order. Every sink - including the serialization and transport sinks - are extensible and can be changed. The .NET FCL provides two formatters - a BinaryFormatter and a SoapFormatter - and two visible channels - a TchChannel and an HttpChannel .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
any idea about runtime polymorphism.
Sreejith S S Nair
|
|
|
|
|
Do you want to be a bit more specific? Right now, there is nothing we can tell you. What are you trying to accomplish?
RageInTheMachine9532
|
|
|
|
|
Is there any concept called "Runtime Polymorphism " in C# or and OOps language
Sreejith S S Nair
|
|
|
|
|
You could have easily found what your looking for by using Google or Yahoo.
C# implements runtime polymorphism through inheritance and method overrides (methods having the same name but different parameter lists).
RageInTheMachine9532
|
|
|
|
|
Can anyone tell me what's the difference between Worker Threads and IO threads?
<processModel enable="true"
•••
maxWorkerThreads="25"
maxIoThreads="25" />
<a href="http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx">Reference here.</a>
Thanks in advance.
Norman Fung
|
|
|
|
|
|
Hi, I have a question about an article I'm reading now: http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx
In figure 5:
public IAsyncResult BeginProcessRequest(HttpContext ctx,
AsyncCallback cb,
object obj)
{
AsyncRequestState reqState =
new AsyncRequestState(ctx, cb, obj);
AsyncRequest ar = new AsyncRequest(reqState);
ThreadStart ts = new ThreadStart(ar.ProcessRequest);
Thread t = new Thread(ts);
t.Start();
return reqState;
}
As far as my understanding goes, every new request is serviced by a HttpApplication derived instance. And it's this HttpApplication derived instance that will call BeginProcessRequest, so how can we specify a callback "cb" and additional arguments encapsulated by "obj".
Thanks!
Norman Fung
|
|
|
|
|
How can i embed an excel application for windows form in c#.
and how can I define a formula for the cell that I want.
Thanks
Rock Throught The Night
|
|
|
|
|
|
I have a datalist with a few events and an event handler in my Code-Behind file.
I need to send post data to a server and open the page.
Say for example when you create a simple html along with all value/pairs.
How can I get this same action from within a datalist control?
I'm thinking I might need to use WebClient class but I'm to new at this to no the easiest way.
Thanx,
Nick
=============================
What was I gonna say...
|
|
|
|
|
|
Well, I'm not to sure. Let me explain alittle of what I want to accomplish. I have bound a product id to my dataList :: DataKeyField="ItemNumber".
So when a user clicks on my LinkButton, I use the product key from DataKeyField and use this to extract details from my database for preparing my post.
I'm trying to post to Paypal IPN... I dont want to use GET because this allows altering of price which is no good.
I think I might be able to use WebClient() for this but am not sure how to go about this.
============================================
I picked up this code and converted it to C#, but does not seem to work for me:
Dim xmlhttp As Object
Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
' Indicate that page that will receive the request and the
' type of request being submitted
xmlhttp.Open "POST", "http://localserver/test.asp", False
' Indicate that the body of the request contains form data
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
' Send the data as name/value pairs
xmlhttp.send "Id=1&S=2"
Set xmlhttp = Nothing
=========================================================
http://www.developerfusion.com/show/3272/2/
I need to figure this out soon...
=============================
What was I gonna say...
|
|
|
|
|
The WebClient won't help you. It's a client class that sends requests to the server and downloads responses.
All server-side events for controls are done through HTTP post. If you actually look at the HTML that is generated and download to the client (the browser, presumably), clicking on a DataList with post-back enabled calls __doPostBack (as does everything else) with certain parameters. Certain hidden fields and any other fields are submitted via theForm.submit() (theForm is the ID of the sole ASP.NET form, unless you change the ID yourself - which you can do).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I wish I could say I knew what you're talking about ...
I am still new in ASP.NET / C# :: Can you dumb this up a bit?
=============================
What was I gonna say...
|
|
|
|
|
Hi, how i search for repeated items in a DataTable?
Example:
I have the Column Name and Email.
I want to delete every Name and Email repeateds.
Thanks.
|
|
|
|