예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
            }
        }