2016-09-22 64 views

回答

1

我使用这个库.NET(它使用VirusTotal公共API):

https://github.com/Genbox/VirusTotal.NET

从GitHub一个小例子:

static void Main(string[] args) 
{ 
    VirusTotal virusTotal = new VirusTotal("INSERT API KEY HERE"); 

    //Use HTTPS instead of HTTP 
    virusTotal.UseTLS = true; 

    FileInfo fileInfo = new FileInfo("testfile.txt"); 

    //Create a new file 
    File.WriteAllText(fileInfo.FullName, "This is a test file!"); 

    //Check if the file has been scanned before. 
    Report fileReport = virusTotal.GetFileReport(fileInfo).First(); 
    bool hasFileBeenScannedBefore = fileReport.ResponseCode == 1; 

    if (hasFileBeenScannedBefore) 
    { 
     Console.WriteLine(fileReport.ScanId); 
    } 
    else 
    { 
     ScanResult fileResults = virusTotal.ScanFile(fileInfo); 
     Console.WriteLine(fileResults.VerboseMsg); 
    } 
} 

完整的例子可以在这里找到:

https://github.com/Genbox/VirusTotal.NET/blob/master/VirusTotal.NET%20Client/Program.cs