Endpoint Protection

 View Only
  • 1.  need help with scanning file through c# and scan engine

    Posted Oct 08, 2010 02:04 PM

    We have symantec scan engine version 5.1 installed on one box and just to rule out version issues, I downloaded the trial version and installed version 5.2 on another box.  I'm using the sample C# code that comes with the trial to try and scan a file.  I've tried both a test virus file and a plain text file.  On both I get the following exception when I get to this line...

    ScanResult scanResult = testObj.Scan(fileForScan);

    Error: System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at com.symantec.scanengine.api.Connection.Read()\r\n   at com.symantec.scanengine.api.FileScanRequestImpl.Scan(String fileToScan)

    Does anyone know what I might be doing wrong?  It seems like an issue with the scanning dll and not my code but that's obviously not something I can change.  I've verified I'm using the correct ip address and port.  Thanks.



  • 2.  RE: need help with scanning file through c# and scan engine

    Posted Oct 12, 2010 02:01 PM

    I have found some other code here that appears to work to a certain degree.  When I test it against version 5.1 scan engine I get the following message reported back.

     

    220 Symantec AntiVirus Scan Engine ready.
    2
    504 Unsupported protocol version.
     
    When I test it against version 5.2 I get back two odd characters.  The first is an upside down T and the second is an L but they're not letters... just some type of characters.
     
    Does anyone know what is going on?  How can I get this to work?  Thanks.