问题描述:

What I need to do is run a Kaspersky Endpoint 10 scan from my visual studio web form.

I'm creating an Image Uploader via telerik:RadAsyncUpload. Once the file is uploaded into the TempFolder, I need to run a command line scan before I can save the uploaded file to a TargetFolder. How do I go about doing this? And how would I be able to return any results to Visual Studio, or even know if a file was suspicious and quarantined?

Thanks in advance. If this is too vague, please let me know of how I can clarify my questions.

网友答案:

Thanks to @AlexisPeters and @EricBurcham, this is what I came up with.

I ended up scripting the necessary commands to run the scan and it works 100%.

Here is my method:

public void ExecuteCommand()
    {
        try
        {
            System.Diagnostics.ProcessStartInfo procStartInfo =
                new System.Diagnostics.ProcessStartInfo(@"C:\cmd.bat")
                {
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    CreateNoWindow = true
                };
            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo = procStartInfo;
            proc.Start();
            proc.WaitForExit();
        }
        catch (Exception)
        {
            throw;
        }
    }
相关阅读:
Top