yes
This commit is contained in:
parent
9f29bfbe59
commit
d73d05c4ee
1 changed files with 4 additions and 11 deletions
|
@ -64,17 +64,10 @@ namespace CreamInstaller
|
||||||
|
|
||||||
public static bool IsFilePathLocked(this string filePath)
|
public static bool IsFilePathLocked(this string filePath)
|
||||||
{
|
{
|
||||||
if (!File.Exists(filePath)) return false;
|
try { File.Open(filePath, FileMode.Open, FileAccess.ReadWrite, FileShare.None).Close(); }
|
||||||
bool Locked = false;
|
catch (FileNotFoundException) { return false; }
|
||||||
try
|
catch (IOException) { return true; }
|
||||||
{
|
return false;
|
||||||
File.Open(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None).Close();
|
|
||||||
}
|
|
||||||
catch (IOException)
|
|
||||||
{
|
|
||||||
Locked = true;
|
|
||||||
}
|
|
||||||
return Locked;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SelectForm SelectForm;
|
public static SelectForm SelectForm;
|
||||||
|
|
Loading…
Reference in a new issue