public static bool HasOpenPassword(Stream file) { try { if (file == null || file.Length == 0) { throw new ArgumentException("Invalid parameter"); } using (Aspose.Security security = new Aspose.Security()) { return security.HasOpenPassword(file); } } catch (Exception ex) { Logger.LogError(ex); throw; } }
public static bool HasOpenPassword(string file) { try { if (String.IsNullOrEmpty(file) || !File.Exists(file)) { throw new ArgumentException("Invalid parameter"); } using (Aspose.Security security = new Aspose.Security()) { return security.HasOpenPassword(file); } } catch (Exception ex) { Logger.LogError(ex); throw; } }