How to work with file (Output , Input) in Qt 5 ??? (Solved)
I know that i can do this with QFile class , but i don't know about working with the functions and streams. (Solved)
My app hangs after the File management code.
My code is the following , notice that the code is a very low-power antivirus solution :
QFile VirusScanner
(Current
);
while(!VirusScanner.atEnd()) {
QString Line
= VirusScanner.
readLine();
if(Line.toLower() == "open=regsvr.exe" || Line.toLower() == "open=newfolder.exe") {
cout << "Autorun.inf virus detected. Deleteing..." << std::endl;
const QString Virus_Path
= VirusScanner.
fileName();
VirusScanner.close();
QFile::remove(Virus_Path
);
}
}
QFile VirusScanner(Current);
while(!VirusScanner.atEnd()) {
QString Line = VirusScanner.readLine();
if(Line.toLower() == "open=regsvr.exe" || Line.toLower() == "open=newfolder.exe") {
cout << "Autorun.inf virus detected. Deleteing..." << std::endl;
const QString Virus_Path = VirusScanner.fileName();
VirusScanner.close();
QFile::remove(Virus_Path);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks