차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
|
ko:bs2_getauthgroup [2017/06/28 11:33] 127.0.0.1 바깥 편집 |
ko:bs2_getauthgroup [2022/05/29 14:58] (현재) mark [함께 보기] |
||
|---|---|---|---|
| 줄 33: | 줄 33: | ||
| ==== 함께 보기 ==== | ==== 함께 보기 ==== | ||
| [[BS2_GetAllAuthGroup]]\\ [[BS2_SetAuthGroup]]\\ [[BS2_RemoveAuthGroup]]\\ [[BS2_RemoveAllAuthGroup]] | [[BS2_GetAllAuthGroup]]\\ [[BS2_SetAuthGroup]]\\ [[BS2_RemoveAuthGroup]]\\ [[BS2_RemoveAllAuthGroup]] | ||
| + | ==== 샘플코드 ==== | ||
| + | C++ | ||
| + | <code cpp> | ||
| + | int UserControl::getUserBlobFaceAuthGroupID(BS2User& user) | ||
| + | { | ||
| + | stringstream msg; | ||
| + | msg << "Please enter a authentication group ID.\n"; | ||
| + | msg << "This is used for face authentication. [0: Not using]"; | ||
| + | uint32_t authGroupID = Utility::getInput<uint32_t>(msg.str()); | ||
| + | user.authGroupID = authGroupID; | ||
| + | |||
| + | return BS_SDK_SUCCESS; | ||
| + | } | ||
| + | |||
| + | BS2_ReleaseObject(uidObj); | ||
| + | </code> | ||
| + | C# | ||
| + | <code cpp> | ||
| + | IntPtr authGroupIDObj = Marshal.AllocHGlobal(4 * authGroupIDList.Count); | ||
| + | IntPtr curAuthGroupIDObj = authGroupIDObj; | ||
| + | foreach (UInt32 item in authGroupIDList) | ||
| + | { | ||
| + | Marshal.WriteInt32(curAuthGroupIDObj, (Int32)item); | ||
| + | curAuthGroupIDObj = (IntPtr)((long)curAuthGroupIDObj + 4); | ||
| + | } | ||
| + | |||
| + | Console.WriteLine("Trying to get auth gruops from device."); | ||
| + | result = (BS2ErrorCode)API.BS2_GetAuthGroup(sdkContext, deviceID, authGroupIDObj, (UInt32)authGroupIDList.Count, out authGroupObj, out numAuthGroup); | ||
| + | |||
| + | Marshal.FreeHGlobal(authGroupIDObj); | ||
| + | BS2_ReleaseObject(uidObj); | ||
| + | </code> | ||