Execute python command line from c# process start
NALB
71
Reputation points
hello i have a command line that output data in Json file
my command line is like below
enum –json (amass.json) –d (domainname.com)
doing it like the below code won't result in JSON format only JSON file.
// start process
using var process = Process.Start(new ProcessStartInfo
{
UseShellExecute = false
FileName = "amass",
RedirectStandardOutput = true,
ArgumentList = { "enum","-json","amass.json", "-d", "test.com" }
});
// read std out
var output = process.StandardOutput.ReadToEnd();
// wait for exit
process.WaitForExit();
// write out out
File.WriteAllText("~/FolderXTest/file.txt", output);
\
I even tried using it with bash but did not work .
I have another question , if my tool output folder not file how to implement that??
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Sign in to answer