حماية هيكل المصنف وإلغاء حمايته
Contents
[
Hide
]
لمنع المستخدمين الآخرين من عرض أوراق العمل المخفية أو إضافة أوراق العمل أو نقلها أو حذفها أو إخفائها وإعادة تسمية أوراق العمل ، يمكنك حماية بنية مصنف Excel بكلمة مرور.
حماية وإلغاء حماية هيكل المصنف في MS Excel
! [حماية بنية المصنف وإلغاء حمايتها] (protect-and-unotect-workbook-structure.png)
- انقرمراجعة> حماية المصنف.
- أدخل كلمة المرور فيمربع كلمة المرور.
- يختارنعم ، وأعد إدخال كلمة المرور لتأكيدها ، ثم حددنعم تكرارا.
حماية بنية المصنف باستخدام Aspose.Cell لـ .Net
تحتاج فقط إلى الأسطر البسيطة التالية من التعليمات البرمجية لتنفيذ حماية هيكل مصنف ملفات Excel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a new file. | |
Workbook workbook = new Workbook(); | |
//Protect workbook structure. | |
workbook.Protect(ProtectionType.Structure, "password"); | |
//Save Excel file. | |
workbook.Save("Book1.xlsx"); |
إلغاء حماية بنية المصنف باستخدام Aspose.Cell لـ .Net
يعد إلغاء حماية بنية المصنف أمرًا سهلاً باستخدام Aspose.Cells API.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Open an Excel file which workbook structure is protected. | |
Workbook workbook = new Workbook("Book1.xlsx"); | |
//Unprotect workbook structure. | |
workbook.Unprotect("password"); | |
//Save Excel file. | |
workbook.Save("Book1.xlsx"); |
ملاحظة: مطلوب كلمة مرور صحيحة.