摘要:
判断文件真实的类型,不是通过扩展名来判断: /// /// 判断文件格式 /// http://www.cnblogs.com/babycool /// /// /// public static bool IsAllowedExtension(string filePath) { FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); ... 阅读全文
摘要:
[操作pdf文档]之C#判断pdf文档的页数: /// /// 获取pdf文档的页数 /// /// /// -1表示文件不存在 public static int GetPDFofPageCount(string filePath) { int count = -1;//-1表示文件不存在 if (File.Exists(filePath)) { using (FileStream fs = n... 阅读全文