Document.IsEncrypted

IsEncrypted(Stream, LoadOptions, out Document)

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

public static bool IsEncrypted(Stream stream, LoadOptions options, out Document document)
معاملنوعالوصف
دفقStreamالتدفق.
خياراتLoadOptionsخيارات التحميل.
مستندDocument&المستند المحمَّل.

قيمة الإرجاع

يرجع true إذا كان المستند مشفرًا وإلا false.

أمثلة

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

// المسار إلى دليل المستندات.
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)
معاملنوعالوصف
دفقStreamالتدفق.
كلمة المرورStringكلمة المرور لفك تشفير مستند.
مستندDocument&المستند المحمَّل.

قيمة الإرجاع

يرجع true إذا كان المستند مشفرًا وإلا false.

أمثلة

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

// المسار إلى دليل المستندات.
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)
معاملنوعالوصف
دفقStreamالتدفق.
مستندDocument&المستند المحمَّل.

قيمة الإرجاع

يرجع true إذا كان المستند مشفرًا وإلا false.

أمثلة

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

// المسار إلى دليل المستندات.
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مسار الملف.
خياراتLoadOptionsخيارات التحميل.
مستندDocument&المستند المحمَّل.

قيمة الإرجاع

يرجع true إذا كان المستند مشفرًا وإلا false.

أمثلة

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

// المسار إلى دليل المستندات.
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مسار الملف.
مستندDocument&المستند المحمَّل.

قيمة الإرجاع

يرجع true إذا كان المستند مشفرًا وإلا false.

أمثلة

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

// المسار إلى دليل المستندات.
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مسار الملف.
كلمة المرورStringكلمة المرور لفك تشفير مستند.
مستندDocument&المستند المحمَّل.

قيمة الإرجاع

يرجع true إذا كان المستند مشفرًا وإلا false.

أمثلة

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

// المسار إلى دليل المستندات.
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.");
}

انظر أيضًا