2016-09-22 61 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