Document.IsEncrypted

IsEncrypted(Stream, LoadOptions, out Document)

للتحقق مما إذا كان مستند من دفق مشفر . للتحقق من ذلك ، نحتاج إلى تحميل هذا المستند بالكامل. لذلك يمكن أن تؤدي هذه الطريقة إلى عقوبة الأداء.

public static bool IsEncrypted(Stream stream, LoadOptions options, out Document document)
معامليكتبوصف
streamStreamالدفق .
optionsLoadOptionsخيارات التحميل .
documentDocument&المستند الذي تم تحميله.

قيمة الإرجاع

يتم إرجاع صحيح إذا تم تشفير المستند أو خطأ.

أمثلة

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (!Document.IsEncrypted(fileName, out document))
{
    Console.WriteLine("The document is loaded and ready to be processed.");
}
else
{
    Console.WriteLine("The document is encrypted. Provide a password.");
}

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور معينة.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (Document.IsEncrypted(fileName, "VerySecretPassword", out document))
{
    if (document != null)
    {
        Console.WriteLine("The document is decrypted. It is loaded and ready to be processed.");
    }
    else
    {
        Console.WriteLine("The document is encrypted. Invalid password was provided.");
    }
}
else
{
    Console.WriteLine("The document is NOT encrypted. It is loaded and ready to be processed.");
}

أنظر أيضا


IsEncrypted(Stream, string, out Document)

للتحقق مما إذا كان مستند من دفق مشفر . للتحقق من ذلك ، نحتاج إلى تحميل هذا المستند بالكامل. لذلك يمكن أن تؤدي هذه الطريقة إلى عقوبة الأداء.

public static bool IsEncrypted(Stream stream, string password, out Document document)
معامليكتبوصف
streamStreamالدفق .
passwordStringكلمة المرور لفك تشفير مستند.
documentDocument&المستند الذي تم تحميله.

قيمة الإرجاع

يتم إرجاع صحيح إذا تم تشفير المستند أو خطأ.

أمثلة

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (!Document.IsEncrypted(fileName, out document))
{
    Console.WriteLine("The document is loaded and ready to be processed.");
}
else
{
    Console.WriteLine("The document is encrypted. Provide a password.");
}

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور معينة.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (Document.IsEncrypted(fileName, "VerySecretPassword", out document))
{
    if (document != null)
    {
        Console.WriteLine("The document is decrypted. It is loaded and ready to be processed.");
    }
    else
    {
        Console.WriteLine("The document is encrypted. Invalid password was provided.");
    }
}
else
{
    Console.WriteLine("The document is NOT encrypted. It is loaded and ready to be processed.");
}

أنظر أيضا


IsEncrypted(Stream, out Document)

للتحقق مما إذا كان مستند من دفق مشفر . للتحقق من ذلك ، نحتاج إلى تحميل هذا المستند بالكامل. لذلك يمكن أن تؤدي هذه الطريقة إلى عقوبة الأداء.

public static bool IsEncrypted(Stream stream, out Document document)
معامليكتبوصف
streamStreamالدفق .
documentDocument&المستند الذي تم تحميله.

قيمة الإرجاع

يتم إرجاع صحيح إذا تم تشفير المستند أو خطأ.

أمثلة

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (!Document.IsEncrypted(fileName, out document))
{
    Console.WriteLine("The document is loaded and ready to be processed.");
}
else
{
    Console.WriteLine("The document is encrypted. Provide a password.");
}

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور معينة.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (Document.IsEncrypted(fileName, "VerySecretPassword", out document))
{
    if (document != null)
    {
        Console.WriteLine("The document is decrypted. It is loaded and ready to be processed.");
    }
    else
    {
        Console.WriteLine("The document is encrypted. Invalid password was provided.");
    }
}
else
{
    Console.WriteLine("The document is NOT encrypted. It is loaded and ready to be processed.");
}

أنظر أيضا


IsEncrypted(string, LoadOptions, out Document)

للتحقق مما إذا كان مستند من ملف مشفر . للتحقق من ذلك ، نحتاج إلى تحميل هذا المستند بالكامل. لذلك يمكن أن تؤدي هذه الطريقة إلى عقوبة الأداء.

public static bool IsEncrypted(string filePath, LoadOptions options, out Document document)
معامليكتبوصف
filePathStringمسار الملف.
optionsLoadOptionsخيارات التحميل .
documentDocument&المستند الذي تم تحميله.

قيمة الإرجاع

يتم إرجاع صحيح إذا تم تشفير المستند أو خطأ.

أمثلة

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (!Document.IsEncrypted(fileName, out document))
{
    Console.WriteLine("The document is loaded and ready to be processed.");
}
else
{
    Console.WriteLine("The document is encrypted. Provide a password.");
}

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور معينة.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (Document.IsEncrypted(fileName, "VerySecretPassword", out document))
{
    if (document != null)
    {
        Console.WriteLine("The document is decrypted. It is loaded and ready to be processed.");
    }
    else
    {
        Console.WriteLine("The document is encrypted. Invalid password was provided.");
    }
}
else
{
    Console.WriteLine("The document is NOT encrypted. It is loaded and ready to be processed.");
}

أنظر أيضا


IsEncrypted(string, out Document)

للتحقق مما إذا كان مستند من ملف مشفر . للتحقق من ذلك ، نحتاج إلى تحميل هذا المستند بالكامل. لذلك يمكن أن تؤدي هذه الطريقة إلى عقوبة الأداء.

public static bool IsEncrypted(string filePath, out Document document)
معامليكتبوصف
filePathStringمسار الملف.
documentDocument&المستند الذي تم تحميله.

قيمة الإرجاع

يتم إرجاع صحيح إذا تم تشفير المستند أو خطأ.

أمثلة

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (!Document.IsEncrypted(fileName, out document))
{
    Console.WriteLine("The document is loaded and ready to be processed.");
}
else
{
    Console.WriteLine("The document is encrypted. Provide a password.");
}

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور معينة.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (Document.IsEncrypted(fileName, "VerySecretPassword", out document))
{
    if (document != null)
    {
        Console.WriteLine("The document is decrypted. It is loaded and ready to be processed.");
    }
    else
    {
        Console.WriteLine("The document is encrypted. Invalid password was provided.");
    }
}
else
{
    Console.WriteLine("The document is NOT encrypted. It is loaded and ready to be processed.");
}

أنظر أيضا


IsEncrypted(string, string, out Document)

للتحقق مما إذا كان مستند من ملف مشفر . للتحقق من ذلك ، نحتاج إلى تحميل هذا المستند بالكامل. لذلك يمكن أن تؤدي هذه الطريقة إلى عقوبة الأداء.

public static bool IsEncrypted(string filePath, string password, out Document document)
معامليكتبوصف
filePathStringمسار الملف.
passwordStringكلمة المرور لفك تشفير مستند.
documentDocument&المستند الذي تم تحميله.

قيمة الإرجاع

يتم إرجاع صحيح إذا تم تشفير المستند أو خطأ.

أمثلة

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (!Document.IsEncrypted(fileName, out document))
{
    Console.WriteLine("The document is loaded and ready to be processed.");
}
else
{
    Console.WriteLine("The document is encrypted. Provide a password.");
}

يوضح كيفية التحقق مما إذا كان المستند محميًا بكلمة مرور معينة.

// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_LoadingAndSaving();
string fileName = Path.Combine(dataDir, "Aspose.one");

Document document;
if (Document.IsEncrypted(fileName, "VerySecretPassword", out document))
{
    if (document != null)
    {
        Console.WriteLine("The document is decrypted. It is loaded and ready to be processed.");
    }
    else
    {
        Console.WriteLine("The document is encrypted. Invalid password was provided.");
    }
}
else
{
    Console.WriteLine("The document is NOT encrypted. It is loaded and ready to be processed.");
}

أنظر أيضا