c# - nclam anti virus is not working with .net application -
i getting issue: no connection made because target machine actively refused 127.0.0.1:3310.
using system; using system.linq; using nclam; class program { static void main(string[] args) { var clam = new clamclient("localhost", 3310); var scanresult = clam.scanfileonserver(@"c:\inetpub\wwwroot\rarextract\parts\eicar_com.zip"); //any file like! switch(scanresult.result) { case clamscanresults.clean: console.writeline("the file clean!"); break; case clamscanresults.virusdetected: console.writeline("virus found!"); console.writeline("virus name: {0}", scanresult.infectedfiles.first().virusname); break; case clamscanresults.error: console.writeline("woah error occured! error: {0}", scanresult.rawresult); break; } } }
it looks not have clamwin service installed or running on machine executing code. wrote directions install here: http://architectryan.com/2011/05/19/nclam-a-dotnet-library-to-virus-scan/.
Comments
Post a Comment