GW2RegisterLicenceFile
GW2RegisterLicenceFile는 세션에 라이선스 파일을 등록합니다.
GW2RegisterLicenceFile 또는 GW2RegisterLicenceMemory 중 어느 것도 세션에 등록되지 않은 경우, Editor는 기본 위치에서 라이선스를 검색하려고 시도합니다. 이는 Editor 라이브러리와 동일한 폴더에 있는 gwkey.lic라는 파일입니다. 이 파일을 찾을 수 없으면 해당 라이브러리는 라이선스가 없는 것으로 간주되며, 일부 프로세스는 라이선스 만료 문제로 실패할 수 있습니다.
- C++
- C#
- Java
- Python
- JavaScript
개요
GW2RegisterLicenceFile 함수는 세션 session이 filename이 가리키는 문자열 이름의 파일에 지정된 라이선스를 사용하도록 요청합니다. 이 라이선스는 해당 세션에 대해 Glasswall이 수행하는 모든 처리에 적용됩니다.
#include "glasswall.core2.api.h"
int GW2RegisterLicenceFile(Session session, const char *filename);
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
예제
#include "glasswall.core2.api.h"
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
if (GW2RegisterLicenceFile(session, "gwkey.lic") < 0)
/* deal with error */
else
/* the file has been successfully registered */
...
/* later */
if (GW2CloseSession(session) < 0)
/* error closing session */
개요
RegisterLicenceFile 메서드는 세션 session이 filename이 가리키는 문자열 이름의 파일에 지정된 라이선스를 사용하도록 요청합니다. 이 라이선스는 해당 세션에 대해 Glasswall이 수행하는 모든 처리에 적용됩니다.
/// <param name="session">Current open Glasswall session</param>
/// <param name="filePath">The file path to the licence file to be registered</param>
public int RegisterLicenceFile(int session, string filePath)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public int GW2RegisterLicenceFile(int session, String licenceFilePath) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterLicenceFile(int session, byte[] licenceFilePath) throws GlasswallException, NullPointerException
참고
The GW2RegisterLicenceFile function parameters have been updated to use String in place of byte[]. The original function has been deprecated.
반환값
GW2RegisterLicenceFile 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하세요.
NullPointerException 예외는 licenceFilePath가 null이거나 비어 있는 경우 발생합니다.
A GlasswallException exception will be thrown if session is invalid, if the licenceFilePath could not be retrieved, or if the licenceFilePath could not be converted to UTF-8.
각 세션의 licence 등록은 Python wrapper에서 자동으로 처리되므로, 사용자가 GW2RegisterLicenceFile 또는 GW2RegisterLicenceMemory를 수동으로 호출할 필요가 없습니다.
By default, the Editor class expects a valid licence file to be located in the same directory as the library_path. You can also specify a different path to a gwkey.lic licence file using the licence argument.
import glasswall
# Load the Glasswall Editor library with a specified licence file
editor = glasswall.Editor(r"C:\gwpw\libraries\10.0", licence=r"C:\gwpw\licence\gwkey.lic")
또는 licence 데이터를 bytes, bytearray 또는 io.BytesIO 객체로 메모리 내에서 전달할 수 있습니다.
import glasswall
# Alternatively, load the licence from in-memory bytes or bytearray
with open(r"C:\gwpw\licence\gwkey.lic", "rb") as f:
licence_data = f.read()
editor = glasswall.Editor(
r"C:\gwpw\libraries\10.0",
licence=licence_data # In-memory licence data
)
개요
RegisterLicenceFile 메서드는 세션 session이 filename이 가리키는 문자열 이름의 파일에 지정된 라이선스를 사용하도록 요청합니다. 이 라이선스는 해당 세션에 대해 Glasswall이 수행하는 모든 처리에 적용됩니다.
/**
* Sets what licence file should be loaded for the session.
* @param {number} session The ID of the session.
* @param {string} filename The filename from which to load the licence.
* @returns {number} Status of the operation; 0 for success, non-zero for failure.
*/
GW2RegisterLicenceFile(session, filename)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.