ตรวจสอบการป้องกันด้วยรหัสผ่านของ PST

Aspose.Email - ตรวจสอบการป้องกันรหัสผ่านของ PST

Microsoft Outlook ให้ผู้ใช้ป้องกันไฟล์ PST ด้วยรหัสผ่านเพื่อจำกัดการเข้าถึง Aspose.Email สามารถตรวจจับการป้องกันด้วยรหัสผ่านบนไฟล์ PST หน้านี้จะแสดงวิธีตรวจสอบว่ามีรหัสผ่านบน PST หรือไม่และยังแสดงวิธีตรวจสอบว่ารหัสผ่านที่ตั้งไว้ถูกต้องหรือไม่

Java

PersonalStorage pst = PersonalStorage.fromFile(dataDir + "archive.pst");

// The store reports whether a password is set and whether a given one is valid
System.out.println("Password protected: " + pst.getStore().isPasswordProtected());
System.out.println("Password valid: " + pst.getStore().isPasswordValid("Password1"));

ดาวน์โหลดโค้ดที่ทำงาน

ดาวน์โหลดโค้ดตัวอย่าง