0

I want to read when my console application going on to running in command line. Although i tried lots of way, i didn't do that. I read many many question and answer in stackoverflow and applied this fixing but i couldn't read. Also i tried some code as below but i couldn't read. I will be crazy and i am confused about it. I couldn't decide maybe it is required using thread but how can i use?

ProcessStartInfo startInfo = new ProcessStartInfo();
Process p = new Process();
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
startInfo.Arguments = "/Scan http://localhost/deneme/sunucu.html /Profile web_applications /SaveToDatabase –ScanningMode=Heuristic –UseAcuSensor=TRUE –EnablePortScanning=TRUE";
startInfo.FileName = @"C:\\Program Files (x86)\\Acunetix\\Web Vulnerability Scanner 9.5\wvs_console.exe";
p.StartInfo = startInfo;
p.OutputDataReceived += (sender, args) => Console.WriteLine("received output: {0}", args.Data);        
p.Start();
p.BeginOutputReadLine();
StreamReader output = p.StandardOutput //i tried beginoutputreadline
p.WaitForExit();        
ListBox1.Items.Add(output.tostring());

Capturing console output from a .NET application (C#) Link below is c# application debugging. It is not solution. My problem is relevant running different application that is name wvs_console.exe. I don't know maybe acunetix provide API for console application. So i would like to know how can i do?
Also as above code is getting error "Additional information: Synchronous and asynchronous operations can not be mixed in the transaction stream."

Is there any idea?

I need your help

Regards

Community
  • 1
  • 1
davy
  • 45
  • 1
  • 9
  • Possible duplicate of [Capturing console output from a .NET application (C#)](http://stackoverflow.com/questions/186822/capturing-console-output-from-a-net-application-c) – John Wu Dec 25 '16 at 01:11
  • http://stackoverflow.com/questions/186822/capturing-console-output-from-a-net-application-c Link is c# application debugging. It is not solution. Also as above code is getting error "Additional information: Synchronous and asynchronous operations can not be mixed in the transaction stream." – davy Dec 25 '16 at 15:31

0 Answers0