차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
ko:bs2_getuserinfosex [2021/12/27 15:11] mark [샘플코드] |
ko:bs2_getuserinfosex [2021/12/29 10:08] (현재) mark [샘플코드] |
||
---|---|---|---|
줄 24: | 줄 24: | ||
==== 샘플코드 ==== | ==== 샘플코드 ==== | ||
C# | C# | ||
- | <code> | + | <code cpp> |
BS2User user = userList[selection]; | BS2User user = userList[selection]; | ||
BS2UserBlobEx[] userBlob = Util.AllocateStructureArray<BS2UserBlobEx>(1); | BS2UserBlobEx[] userBlob = Util.AllocateStructureArray<BS2UserBlobEx>(1); | ||
- | if (dbHandler.GetUserBlobEx(ref deviceInfo, ref user, ref userBlob[0])) | + | if (dbHandler.GetUserBlobEx(ref deviceInfo, ref user, ref userBlob[0])) |
- | { | + | { |
- | Console.WriteLine("Trying to enroll user."); | + | ///사용자 등록 및 함수추가 |
- | BS2ErrorCode result = (BS2ErrorCode)API.BS2_EnrolUserEx(sdkContext, deviceID, userBlob, 1, 1); | + | } |
- | //BS2ErrorCode result = (BS2ErrorCode)API.BS2_EnrollUserEx(sdkContext, deviceID, userBlob, 1, 1); | + | if (result != BS2ErrorCode.BS_SDK_SUCCESS) |
- | if (result != BS2ErrorCode.BS_SDK_SUCCESS) | + | { |
- | { | + | Console.WriteLine("Got error({0}).", result); |
- | Console.WriteLine("Got error({0}).", result); | + | } |
- | } | + | |
- | if (userBlob[0].cardObjs != IntPtr.Zero) | + | if (userBlob[0].cardObjs != IntPtr.Zero) |
- | { | + | { |
- | Marshal.FreeHGlobal(userBlob[0].cardObjs); | + | Marshal.FreeHGlobal(userBlob[0].cardObjs); |
- | } | + | } |
- | + | if (userBlob[0].fingerObjs != IntPtr.Zero) | |
- | if (userBlob[0].fingerObjs != IntPtr.Zero) | + | { |
- | { | + | Marshal.FreeHGlobal(userBlob[0].fingerObjs); |
- | Marshal.FreeHGlobal(userBlob[0].fingerObjs); | + | } |
- | } | + | if (userBlob[0].faceObjs != IntPtr.Zero) |
- | + | { | |
- | if (userBlob[0].faceObjs != IntPtr.Zero) | + | Marshal.FreeHGlobal(userBlob[0].faceObjs); |
- | { | + | } |
- | Marshal.FreeHGlobal(userBlob[0].faceObjs); | + | |
- | } | + | |
- | } | + | |
</code> | </code> | ||