{
string[] textArray1;
try
{
if (path == null)
{
return false;
}
if (path.Length == 0)
{
return false;
}
path = Path.GetFullPathInternal(path);
textArray1 = new string[1];
textArray1[0] = path;
new FileIOPermission(1, textArray1, 0, 0).Demand(); //显式的要求一个权限
return File.InternalExists(path);
}
catch (ArgumentException)
{
}
catch (NotSupportedException)
{
}
catch (SecurityException) //出现异常之后并没有抛出
{
}
catch (IOException)
{
}
catch (UnauthorizedAccessException)
{
}
return false; //这就是你看到的false
}
362



被折叠的 条评论
为什么被折叠?



