diamond diamond

diamond diamond

  • NA
  • 133
  • 54.1k

processstartinfo arguments problem

Apr 10 2014 2:07 AM
Hi all,
I want to call cce.exe with 7 arguments (cce 5 50 0 filename 0 file name)
when I run this code it gives an error "process find a valid specification file "
I may be the arguments are incorrect.


if (g.Count() > 1)
                    {
                        // sw.Write(String.Format("{0,-15}  {1,-15}  ", g.Key.source, g.Key.dest));
                        double packet = Convert.ToDouble(g.ElementAt(0)["pkts"]);

                        TextWriter swtest = new StreamWriter(@"C:\Hellotest.txt", true);
                        TextWriter sw = new StreamWriter(@"C:\Hello.txt", true);
                        for (int i = 1; i < g.Count(); i++)
                        {
                            packet = Convert.ToDouble(g.ElementAt(i)["pkts"]);
                            // if (i > 1) sw.Write(new string(' ', 34));
                            //richTextBox1.Text += "ip.src: " + g.Key.source + "ip.dst: " + g.Key.dest + "difference: " + (time2 - time1).ToString() + "\r\n";  //"winc:" + winc + "   FP:" + FP1.Count() + "   TP:" + TP1.Count() + "   FPRate:" + FPRate + "  Detection rate:" + DetectionRate + "  bot:" + g.Count + "\r\n";

                            sw.WriteLine(packet);
                            swtest.WriteLine(packet);
                        }
                        sw.Close();
                        swtest.Close();
                        var psi = new ProcessStartInfo
                        {
                            FileName = @"c:\Users\botnet\Desktop\entropy\entropy\cce.exe",
                            Arguments = "cce"+5+ 50+ 0+ @"C:\Hellotest.txt" + 0 + @"C:\Hello.txt",
                            UseShellExecute = false,
                            RedirectStandardOutput = true,
                        };
                        var process = Process.Start(psi);
                        if (process.WaitForExit((int)TimeSpan.FromSeconds(10).TotalMilliseconds))
                        {
                            var result = process.StandardOutput.ReadToEnd();
                            if (Convert.ToDouble(result) < 2)
                                srcaddress.Add(g.Key.source.ToString());
                            MessageBox.Show(result.ToString());
                        }

                    }
Please help me

Answers (4)