/// <summary>
/// 判断图像文件是否完好
/// </summary>
/// <param name="path">全路径</param>
/// <returns>结果</returns>
public static bool IsImageIntact(string path)
{
byte[] memory = null; try{
memory =
File.ReadAllBytes(path); if (memory.Length == 0){
return false;}
return true;}
catch (IOException io){
Console.WriteLine(DateTime.Now + io.Message); return false;}
catch (Exception ex){
Console.WriteLine(DateTime.Now + ex.Message); return false;}
finally{
memory =
null;}
}
2155

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



