forked from tejashwikalptaru/csharp-clamAV-antivirus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsoleSetups.cs
31 lines (30 loc) · 969 Bytes
/
ConsoleSetups.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace AntiVirus_Project
{
class ConsoleSetups
{
public string RunExternalExe(string filename, string arguments = null)
{
try
{
Process compiler = new Process();
compiler.StartInfo.FileName = filename;
compiler.StartInfo.Arguments = arguments;
compiler.StartInfo.CreateNoWindow = true;
compiler.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
return compiler.StandardOutput.ReadToEnd();
}
catch(Exception ex)
{
return ex.Message;
}
}
}
}