FileStream fs = null;
bool inUse = true;
try
{
fs = new FileStream(fortifyService.PathManipulation(e.FullPath), FileMode.Open, FileAccess.Read, FileShare.None);
inUse = false;
}
catch
{
}
finally
{
if (fs != null)
fs.Close();
Log.WriteToLog("Info", "file:{0}, inuse={1};", fortifyService.PathManipulation(e.FullPath), inUse.ToString());
}
bool inUse = true;
try
{
fs = new FileStream(fortifyService.PathManipulation(e.FullPath), FileMode.Open, FileAccess.Read, FileShare.None);
inUse = false;
}
catch
{
}
finally
{
if (fs != null)
fs.Close();
Log.WriteToLog("Info", "file:{0}, inuse={1};", fortifyService.PathManipulation(e.FullPath), inUse.ToString());
}
沒有留言:
張貼留言