samedi 24 décembre 2016

How to read step by step when my .exe file going on to running in commandline in asp.net c#

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 above 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?

I need your help Regards.

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());




Aucun commentaire:

Enregistrer un commentaire