TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rajagopalan R V
NA
336
70.6k
Virus Scanning Code Not Working Properly in ASP.NET 4.0 C#
Apr 10 2015 7:46 AM
//do av check here
Process
myProcess =
new
Process
();
//address of command line virus scan exe
myProcess.StartInfo.FileName =
"C:\\Program Files\\Symantec\\Symantec Endpoint Protection\\SymCorpUI.exe"
;
string
myprocarg =
"/SCAN="
+ fileNames +
" /REPORT=C:\\Upload\\Temp\\Report.txt"
;
myProcess.StartInfo.Arguments = myprocarg;
myProcess.StartInfo.UseShellExecute =
false
;
myProcess.StartInfo.RedirectStandardInput =
true
;
myProcess.StartInfo.RedirectStandardOutput =
true
;
myProcess.StartInfo.RedirectStandardError =
true
;
myProcess.Start();
StreamWriter
inputWriter = myProcess.StandardInput;
StreamReader
outputReader = myProcess.StandardOutput;
StreamReader
errorReader = myProcess.StandardError;
myProcess.WaitForExit();
myProcess.Close();
//add some time for report to be written to file
int
j = 0;
int
y = 0;
for
(j = 0; j <= 1000000; j++)
{
y = y + 1;
}
bool
IsClean =
true
;
//Get a StreamReader class that can be used to read the file
StreamReader
objStreamReader =
default
(
StreamReader
);
objStreamReader =
File
.OpenText(
"C:\\Upload\\Temp\\Report.txt"
);
if
(!objStreamReader.ReadToEnd().Contains(
"Found infections : 0"
))
{
IsClean =
false
;
File
.Delete(filepath +
"\\"
+ fileNames);
}
objStreamReader.Close();
if
(IsClean)
{
}
else
{
}
catch
(
Exception
)
{
bool
IsClean =
true
;
Msgbox.DisplayAJAXMessage(this,"Some Error While Attaching Your File");
IsClean =
false
;
File
.Delete(filepath +
"\\"
+ fileNames);
}
}
Hi Friends
The Above Code is Used to Scan and to Find Virus Upload the Attachment or files in the Server but its not working properly its executing well but its not generating any Details in Reports.txt What is the Problem i've Done i Dono with This Please Let Me Know ASAP
Regards.....,
R.V.Rajagopalan
Reply
Answers (
0
)
identity in authentication in web api
how to read E-Aadhaar Pdf and Save into Database ?