การออกใบอนุญาตและการสมัครสมาชิก

บางครั้งเพื่อที่จะศึกษาระบบที่ดีขึ้นคุณต้องการที่จะดำน้ำในรหัสให้เร็วที่สุดเท่าที่เป็นไปได้ เพื่อให้ง่ายขึ้นAspose.Wordsมีแผนการที่แตกต่างกันสำหรับการซื้อหรือมีการทดลองใช้ฟรีและใบอนุญาตชั่วคราว 30 วันสำหรับการประเมิน.

ทดลองใช้ฟรีหรือใบอนุญาตชั่วคราว

Aspose.Wordsเป็นซอฟต์แวร์ที่น่าทึ่งที่นักพัฒนาสามารถลองก่อนที่จะซื้อ.

ทดลองใช้ฟรี

รุ่นการประเมินเป็นเช่นเดียวกับที่ซื้อ– รุ่นทดลองใช้ เพียงแค่กลายเป็นใบอนุญาตเมื่อคุณเพิ่มไม่กี่บรรทัดของรหัสที่จะใช้ใบอนุญาต.

รุ่นทดลองของAspose.Wordsโดยไม่มีใบอนุญาตที่ระบุจะให้ฟังก์ชันการทำงานของผลิตภัณฑ์อย่างเต็มที่แต่.

ใบอนุญาตชั่วคราว

หากคุณต้องการทดสอบAspose.Wordsโดยไม่มีข้อจำกัดของรุ่นทดลองคุณยังสามารถขอใบอนุญาตชั่วคราว 30 วัน สำหรับรายละเอียดเพิ่มเติมโปรดดูที่ รับใบอนุญาตชั่วคราว เพจ.

ซื้อใบอนุญาต

หลังจากที่ซื้อคุณจะต้องใช้ไฟล์ใบอนุญาตหรือรวมไฟล์ใบอนุญาตเป็นทรัพยากรที่ฝังตัว ส่วนนี้จะอธิบายถึงตัวเลือกของวิธีนี้สามารถทำได้,และยังแสดงความคิดเห็นเกี่ยวกับคำถา.

การปกป้องใบอนุญาตซื้อของคุณ

หลังจากซื้อใบอนุญาตคุณจะต้องระมัดระวังอ่านข้อมูลในหน้า การปกป้องใบอนุญาตซื้อของคุณ เพื่อปกป้องไฟล์ใบอนุญาตของคุณ โปรดทราบว่าหน้านี้สามารถใช้ได้สำหรับการดูเฉพาะในกรณีที่คุณมีใบอนุญาตการชำระเงิน.

ตัวเลือกการใช้ใบอนุญาต

ใบอนุญาตสามารถนำมาใช้จากสถานที่ต่างๆ:

  • พาธที่ชัดเจน
  • โฟลเดอร์ที่มีแฟ้มAspose.Words_\*.dll
  • โฟลเดอร์ที่มีแอสเซมบลีที่เรียกว่าAspose.Words_\*.dll
  • โฟลเดอร์ที่มีแอสเซมบลีรายการ(ของคุณ.exe)
  • รีซอร์สที่ฝังอยู่ในแอสเซมบลีเรียกว่าAspose.Words_\*.dll

บ่อยครั้งที่วิธีที่ง่ายที่สุดในการตั้งค่าใบอนุญาตคือการวางไฟล์ใบอนุญาตไว้ในโฟลเดอร์เดียวกับ Aspose.Words_\*.dll และระบุเพียงแค่ชื่อไฟล์โดยไม่ต้องระบุเส้นทาง.

ใช้ใบอนุญาตโดยใช้แฟ้มหรือสตรีมวัตถุ

เมื่อพัฒนาโปรแกรมประยุกต์ของคุณ,โทรSetLicenseในรหัสเริ่มต้นของคุณก่อนที่จะใช้Aspose.Wordsคลาส.

โหลดใบอนุญาตจากแฟ้ม

ใช้วิธีการSetLicenseคุณสามารถลองค้นหาไฟล์ใบอนุญาตในทรัพยากรฝังตัวหรือโฟลเดอร์แอสเซมบลี.

ตัวอย่างรหัสต่อไปนี้แสดงวิธีการเริ่มต้นใบอนุญาตจากโฟลเดอร์:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C.git.
auto license = MakeObject<License>();
// This line attempts to set a license from several locations relative to the executable and Aspose.Words.dll.
// You can also use the additional overload to load a license from a stream, this is useful,
// for instance, when the license is stored as an embedded resource.
try
{
license->SetLicense(u"Aspose.Words.Cpp.lic");
std::cout << "License set successfully." << std::endl;
}
catch (System::Exception& e)
{
// We do not ship any license with this example,
// visit the Aspose site to obtain either a temporary or permanent license.
std::cout << (String(u"\nThere was an error setting the license: ") + e->get_Message()) << std::endl;
}
โหลดใบอนุญาตจากอ็อบเจ็กต์สตรีม

ตัวอย่างรหัสต่อไปนี้แสดงวิธีการเริ่มต้นใบอนุญาตจากสตรีมโดยใช้วิธีการSetLicenseอื่น:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C.git.
auto license = MakeObject<License>();
try
{
license->SetLicense(MakeObject<System::IO::MemoryStream>(System::IO::File::ReadAllBytes(u"Aspose.Words.Cpp.lic")));
std::cout << "License set successfully." << std::endl;
}
catch (System::Exception& e)
{
// We do not ship any license with this example,
// visit the Aspose site to obtain either a temporary or permanent license.
std::cout << (String(u"\nThere was an error setting the license: ") + e->get_Message()) << std::endl;
}

รวมไฟล์ใบอนุญาตเป็นทรัพยากรที่ฝังตัว

วิธีเรียบร้อยแพคเกจใบอนุญาตกับโปรแกรมประยุกต์ของคุณและให้แน่ใจว่ามันจะไม่สูญหา วิธีการฝังและใช้ทรัพยากรขึ้นอยู่กับแพลตฟอร์มเป้าหมายของคุณ.

Windows

สมมติว่าคุณได้เพิ่มใบอนุญาตเป็นทรัพยากรที่แสดงด้านล่าง.

resource.h
#define IDR_ASPOSE_WORDS_LIC            101
resource.rc
IDR_ASPOSE_WORDS_LIC RCDATA "Aspose.Words.Cpp.lic"

ตัวอย่างรหัสต่อไปนี้แสดงวิธีการเริ่มต้นใบอนุญาตจากทรัพยากรฝังตัวโดยใช้วิธีการSetLicense:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C.git.
auto hResource = FindResource(nullptr, MAKEINTRESOURCEA(IDR_ASPOSE_WORDS_LIC), RT_RCDATA);
auto hMemory = LoadResource(nullptr, hResource);
auto size = SizeofResource(nullptr, hResource);
auto ptr = LockResource(hMemory);
auto licResource = System::MakeArray<uint8_t>(size);
std::copy_n(static_cast<const uint8_t*>(ptr), size, licResource->begin());
FreeResource(hMemory);
auto license = System::MakeObject<License>();
try
{
license->SetLicense(MakeObject<System::IO::MemoryStream>(licResource));
std::cout << "License set successfully." << std::endl;
}
catch (System::Exception& e)
{
std::cout << (String(u"\nThere was an error setting the license: ") + e->get_Message()) << std::endl;
}
Linux

มีวิธีที่คล้ายกันในการฝังทรัพยากรบนLinuxในปฏิบัติการได้.

ตัวอย่างรหัสรหัสต่อไปนี้แสดงวิธีการเริ่มต้นใบอนุญาตจากทรัพยากรฝังตัวโดยใช้วิธีการSetLicense:

// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C.git.
// A file named Aspose.Words.lic is 'imported' into an object file
// using the following command:
//
// ld -r -b binary -o aspose.words.lic.o Aspose.Words.lic
//
// That creates an object file named "aspose.words.lic.o" with the following
// symbols:
//
// _binary_aspose_words_lic_start
// _binary_aspose_words_lic_end
// _binary_aspose_words_lic_size
//
// Note that the symbols are addresses
extern uint8_t _binary_aspose_words_lic_start[];
extern uint8_t _binary_aspose_words_lic_end[];
extern uint8_t _binary_aspose_words_lic_size[];
std::ptrdiff_t size = _binary_aspose_words_lic_end - _binary_aspose_words_lic_start;
auto licResource = System::MakeArray<uint8_t>(size);
std::copy(_binary_aspose_words_lic_start, _binary_aspose_words_lic_end, licResource->begin());
auto license = MakeObject<License>();
try
{
license->SetLicense(MakeObject<System::IO::MemoryStream>(licResource));
std::cout << "License set successfully." << std::endl;
}
catch (System::Exception& e)
{
std::cout << (String(u"\nThere was an error setting the license: ") + e->get_Message()) << std::endl;
}

การเปลี่ยนชื่อแฟ้มใบอนุญาต

ชื่อแฟ้มใบอนุญาตไม่จำเป็นต้อง"Aspose.Words.LIC" คุณสามารถเปลี่ยนชื่อให้เป็นที่ชื่นชอบของคุณและใช้ชื่อนั้นเมื่อตั้งค่าใบอนุญาตในใบสมัครข.

“ไม่สามารถหาชื่อไฟล์ใบอนุญาต"ข้อยกเว้น

เมื่อคุณซื้อและดาวน์โหลดใบอนุญาตเว็บไซต์แอสโพสจะตั้งชื่อไฟล์ใบอนุญาต*“Aspose.Words.LIC”* คุณดาวน์โหลดไฟล์ใบอนุญาตโดยใช้เบราว์เซอร์ของคุณ ในกรณีนี้เบราว์เซอร์บางคนรู้จักไฟล์ใบอนุญาตเป็นXMLและผนวกไฟล์ชื่อแฟ้มเต็มบนคอมพิวเตอร์ของคุณจะกลายเป็น*“Aspose.Words.lic.XML”*.

เมื่อMicrosoft Windowsถูกกำหนดค่าให้ซ่อนส่วนขยายสำหรับประเภทไฟล์ที่รู้จัก(แต่น่าเสียดายที่เป็นค่าเริ่มต้นในการติดตั้งWindowsส่วนใหญ่)ไฟล์ใบอนุญาตจะปรากฏเป็น*“Aspose.Words. LIC”*ในWindows Explorer คุณอาจจะคิดว่านี่คือชื่อไฟล์จริงและโทร**SetLicense**ผ่านมัน*“Aspose.Words.LIC”*แต่ไม่มีไฟล์ดังกล่าว,ดังนั้นข้อยกเว้น.

เมื่อต้องการแก้ปัญหาให้เปลี่ยนชื่อแฟ้มเพื่อลบสิ่งที่มองไม่เห็นรือไม่ นอกจากนี้เรายังแนะนำให้คุณปิดใช้งานตัวเลือก"ซ่อนส่วนขยาย"ในMicrosoft Windows.

การใช้ผลิตภัณฑ์แอสโพส

หากคุณใช้ผลิตภัณฑ์แอสโปสหลายรายการในแอปพลิเคชันของคุณเช่นAspose.WordsและAspose.Cellsนี่คือเคล็ดลับที่มีประโยชน์บางประการ:

  • ตั้งค่าใบอนุญาตสำหรับแต่ละผลิตภัณฑ์แอสโปสแยกต่างหาก แม้ว่าคุณจะมีไฟล์ใบอนุญาตเดียวสำหรับคอมโพเนนต์ทั้งหมดตัวอย่างเช่น"Aspose.Total.lic"คุณยังคงต้องโทรSetLicenseแยกต่างหากสำหรับแต่ละผลิตภัณฑ์แอสโพสที่คุณใช้ในแอปพลิเคชันของคุณ.
  • ใช้ชื่อชั้นใบอนุญาตที่มีคุณสมบัติครบถ้วน ผลิตภัณฑ์แอสโพสแต่ละผลิตภัณฑ์มีLicenseชั้นในเนมสเปซของตัวเอง ตัวอย่างเช่นAspose.WordsมีAspose.Words.LicenseและAspose.CellsมีAspose.Cellsชั้นใบอนุญาต การใช้ชื่อชั้นที่มีคุณสมบัติครบถ้วนช่วยให้คุณหลีกเลี่ยงความสับสนว่าใบอนุญาตใดใช้กับผลิตภั.