1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
public static bool IsFileWritable(string path)
{
try
{
if (!File.Exists(path))
{
return true;
}
using (System.IO.FileStream stream = File.OpenWrite(path))
{
stream.Close();
}
return true;
}
catch (Exception)
{
return false;
}
}
|