.NET病毒扫描API

58

我正在构建一个Web应用程序,需要扫描用户上传的文件以查找病毒。

有没有经验在此方面建设应用程序的人可以提供有关如何启动和运行此类应用程序的信息?我猜想杀毒软件包具有访问其功能的API,但好像很难获得详细信息。

请注意,该应用程序是用C#编写的。


请查看此问题,它应该会有所帮助。 - Shoban
这个非常可靠,而且实际上是免费的:https://www.cloudmersive.com/virus-api - A X
12个回答

-2
从我的经验来看,您可以使用COM与某些反病毒软件进行接口交互。但是我建议的方法更简单,只需在扫描后解析扫描结果即可。您需要做的就是启动扫描器进程并将其指向要扫描的文件/文件夹,将扫描结果存储到文件中或将stdout重定向到您的应用程序并解析结果。

-4
//Scan  
string start = Console.ReadLine();  
System.Diagnostics.Process scanprocess = new System.Diagnostics.Process();  
sp.StartInfo.WorkingDirectory = @"<location of your antivirus>";  
sp.StartInfo.UseShellExecute = false;  
sp.StartInfo.FileName = "cmd.exe";  
sp.StartInfo.Arguments = @"/c antivirusscanx.exe /scan="+filePath;  
sp.StartInfo.CreateNoWindow = true;  
sp.StartInfo.RedirectStandardInput = true;    
sp.StartInfo.RedirectStandardError = true; sp.Start();  
string output = sp.StandardOutput.ReadToEnd();  
//Scan results  
System.Diagnostics.Process pr = new System.Diagnostics.Process();      
pr.StartInfo.FileName = "cmd.exe";  
pr.StartInfo.Arguments = @"/c echo %ERRORLEVEL%";   
pr.StartInfo.RedirectStandardInput = true;    
pr.StartInfo.RedirectStandardError = true; pr.Start();  
output = processresult.StandardOutput.ReadToEnd();  
pr.Close(); 

2
你能在这里写一个详细的解释吗?例如,我在哪里可以找到antivirusscanx.exe? - nu everest

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接