ทำงานกับ IBM Notes

เกี่ยวกับ IBM Notes

IBM Notes เป็นไคลเอนต์และ IBM Domino เป็นเซิร์ฟเวอร์ของแพลตฟอร์มซอฟต์แวร์คลไอเอ็นท์-เซิร์ฟเวอร์แบบร่วมมือ IBM Notes ให้คุณลักษณะการร่วมมือเช่น อีเมล, ปฏิทิน, รายการทำงาน, การจัดการผู้ติดต่อ ฯลฯ ไฟล์ฐานข้อมูลที่ใช้โดย IBM Notes จะถูกบันทึกในรูปแบบ Notes Storage Facility (NSF).

ตรวจจับไฟล์ในรูปแบบ NSF

ตัวอย่างโค้ดด้านล่างจะแสดงวิธีตรวจจับรูปแบบไฟล์ NSF:

// Returns FileFormatType.Nsf for an NSF storage file
int formatType = FileFormatUtil.detectFileFormat("storage.nsf").getFileFormatType();

if (formatType == FileFormatType.Nsf) {
    System.out.println("The file is in the NSF format.");
}

อ่านข้อความจากไฟล์จัดเก็บ NSF

Aspose.Email ให้ NotesStorageFacility class เพื่ออ่านไฟล์จัดเก็บ NSF. The NotesStorageFacility class ให้ EnumerateMessages method ที่วนซ้ำข้อความในไฟล์จัดเก็บ NSF ตัวอย่างโค้ดต่อไปนี้แสดงการใช้ NotesStorageFacility class และ EnumerateMessages method เพื่ออ่านข้อความจากไฟล์จัดเก็บ NSF.

// For complete examples and data files, please go to https://github.com/aspose-email/Aspose.Email-for-Java
// The path to the resource directory.
String dataDir = "data/";

NotesStorageFacility nsf = new NotesStorageFacility(dataDir + "SampleNSF.nsf");
try {
    for (MailMessage eml : nsf.enumerateMessages()) {
        System.out.println(eml.getSubject());
    }
} finally {
    nsf.dispose();
}