Click here to Skip to main content
15,915,702 members
Home / Discussions / C#
   

C#

 
QuestionRe: modify XmlDictionaryReaderQuotas Pin
Keith Barrow26-Dec-10 7:27
professionalKeith Barrow26-Dec-10 7:27 
QuestionRe: modify XmlDictionaryReaderQuotas Pin
abbd26-Dec-10 7:30
abbd26-Dec-10 7:30 
AnswerRe: modify XmlDictionaryReaderQuotas Pin
Keith Barrow26-Dec-10 7:59
professionalKeith Barrow26-Dec-10 7:59 
QuestionRe: modify XmlDictionaryReaderQuotas Pin
abbd26-Dec-10 8:04
abbd26-Dec-10 8:04 
QuestionRe: modify XmlDictionaryReaderQuotas Pin
abbd26-Dec-10 23:18
abbd26-Dec-10 23:18 
QuestionRedirecting standard output of an application Pin
TcachTcachTcach25-Dec-10 21:36
TcachTcachTcach25-Dec-10 21:36 
AnswerRe: Redirecting standard output of an application Pin
Abhinav S25-Dec-10 23:18
Abhinav S25-Dec-10 23:18 
GeneralRe: Redirecting standard output of an application Pin
TcachTcachTcach26-Dec-10 0:26
TcachTcachTcach26-Dec-10 0:26 
Thanks, but I don`t want to use any files.
Here is the code that i use, but it is not a real - time!
private void button2_Click(object sender, RoutedEventArgs e)
        {

            Thread Runst = new Thread(Run);
            Runst.Start();           
            
        }

        public void Run()
        {
            ProcessStartInfo processStartInfo = new ProcessStartInfo("C:\\test.exe");
            processStartInfo.ErrorDialog = false;
            processStartInfo.UseShellExecute = false;
            processStartInfo.RedirectStandardError = true;
            processStartInfo.RedirectStandardInput = true;
            processStartInfo.RedirectStandardOutput = true;            
            //processStartInfo.CreateNoWindow = true; //no console window



            Process process = new Process();
            process.StartInfo = processStartInfo;
            bool processStarted = process.Start();

            while (!process.StandardOutput.EndOfStream)
            {
                
                textBox2.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate()
                {
                    textBox2.Text += process.StandardOutput.ReadLine() + Environment.NewLine;
                                        
                });
                
            }
                
                
        }


test.cpp
#include <stdio.h>
#include <windows.h>


int main()
{
	for (int i=0;i<=30;i++)
	{
	fprintf(stdout,"%d) This is NORMALL stout (0-30)\n",i);		
	Sleep(100);
	}

	/*for (int i=30;i<=60;i++)
	{
	fprintf(stderr,"%d) This is ERROR stout (30-60)\n",i);		
	Sleep(100);
	}*/		
}


Also,this is not a solution!
process.OutputDataReceived += new DataReceivedEventHandler(CatchOutHandler);

AnswerRe: Redirecting standard output of an application Pin
Luc Pattyn26-Dec-10 1:57
sitebuilderLuc Pattyn26-Dec-10 1:57 
GeneralRe: Redirecting standard output of an application Pin
TcachTcachTcach26-Dec-10 2:32
TcachTcachTcach26-Dec-10 2:32 
AnswerRe: Redirecting standard output of an application Pin
Luc Pattyn26-Dec-10 3:02
sitebuilderLuc Pattyn26-Dec-10 3:02 
GeneralRe: Redirecting standard output of an application Pin
TcachTcachTcach26-Dec-10 3:47
TcachTcachTcach26-Dec-10 3:47 
GeneralRe: Redirecting standard output of an application Pin
Luc Pattyn26-Dec-10 3:55
sitebuilderLuc Pattyn26-Dec-10 3:55 
AnswerRe: Redirecting standard output of an application Pin
PIEBALDconsult26-Dec-10 4:56
mvePIEBALDconsult26-Dec-10 4:56 
GeneralRe: Redirecting standard output of an application Pin
TcachTcachTcach27-Dec-10 23:12
TcachTcachTcach27-Dec-10 23:12 
QuestionWeak reference and garbage collection Pin
thomus0724-Dec-10 22:24
thomus0724-Dec-10 22:24 
AnswerRe: Weak reference and garbage collection Pin
#realJSOP25-Dec-10 0:35
professional#realJSOP25-Dec-10 0:35 
AnswerRe: Weak reference and garbage collection Pin
SledgeHammer0125-Dec-10 7:27
SledgeHammer0125-Dec-10 7:27 
GeneralRe: Weak reference and garbage collection Pin
thomus0725-Dec-10 19:03
thomus0725-Dec-10 19:03 
AnswerRe: Weak reference and garbage collection Pin
Pete O'Hanlon25-Dec-10 8:41
mvePete O'Hanlon25-Dec-10 8:41 
GeneralRe: Weak reference and garbage collection Pin
thomus0725-Dec-10 19:06
thomus0725-Dec-10 19:06 
AnswerRe: Weak reference and garbage collection Pin
_Erik_27-Dec-10 2:46
_Erik_27-Dec-10 2:46 
AnswerRe: Weak reference and garbage collection Pin
jschell27-Dec-10 8:12
jschell27-Dec-10 8:12 
QuestionAnswer this question Pin
mohammed alshaweesh24-Dec-10 4:23
mohammed alshaweesh24-Dec-10 4:23 
JokeRe: Answer this question PinPopular
PIEBALDconsult24-Dec-10 4:31
mvePIEBALDconsult24-Dec-10 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.