Click here to Skip to main content
15,908,661 members

Comments by Unaragan (Top 1 by date)

Unaragan 12-Mar-15 8:36am View    
Deleted
using System;
using System.Collections.Generic;
using System.IO;

namespace CAVACheck
{
class Program
{
private string EMCHost;
private string EMCFileSystem;

static void Main(string[] args)
{

Program CAVACheck = new Program();

CAVACheck.WriteEICARFileToShare();
CAVACheck.WriteEICARLogFile();

}

private void ReadCSVtoVariable()
{
//string _EMCHost{};

var reader = new StreamReader(File.OpenRead(@"c:\scripts\Filesystems.csv"));
List<string> _EMCHost = new List<string>();
List<string> _EMCFileSystem = new List<string>();
while (!reader.EndOfStream)
{
var line = reader.ReadLine();
var values = line.Split(';');
// how to return this values to use in WriteEICARFileToShare???
return EMCHost = _EMCHost.Add(values[0]);
return EMCFileSystem = _EMCFileSystem.Add(values[1]);

}
}

private void WriteEICARFileToShare()
{
StreamWriter EicarFile = new StreamWriter("\\\\" + EMCHost + "\\" + EMCFileSystem + @"EICAR.TXT");
EicarFile.WriteLine(@"X5O!P%@AP[4\PZX54(P^)7CC)7}$"+"EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$"+"H+H*");

EicarFile.Close();
}

private void WriteEICARLogFile()
{
StreamWriter EicarCheckLog = new StreamWriter(@"c:\scripts\Filesystems.log");
EicarCheckLog.WriteLine("\\\\"+ EMCHost+"\\"+ EMCFileSystem +"$ Writing of EicarTestVirus not possible -Blocked by McAfee");

EicarCheckLog.Close();
}
}
}