Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. public List<UserInfo> GetUsers()
  2.         {
  3.             string tablename = "user";
  4.             int numberOfUsers = 0;
  5.             string str = "*";// "CardNo\tPin\tPassword\tGroup\tStartTime\tEndTime";
  6.             int BUFFERSIZE = 1 * 1024 * 1024;
  7.             byte[] buffer = new byte[BUFFERSIZE];
  8.             string options = "";
  9.             bool opt = false;
  10.             List<UserInfo> AllUsers = new List<UserInfo>();
  11.  
  12.             if (IntPtr.Zero != h)
  13.             {
  14.                                 //External Крашиться здесь
  15.                 numberOfUsers = GetDeviceData(h, ref buffer[0], BUFFERSIZE, devtablename, str, devdatfilter, options);
  16.             }
  17.             else
  18.             {
  19.                 return AllUsers;
  20.             }
  21.  
  22.             if (numberOfUsers >= 0)
  23.             {
  24.                 AllUsers = GetUsersFromBuffer(buffer, numberOfUsers);
  25.                 return AllUsers;
  26.  
  27.             }
  28.             else
  29.             {
  30.                 PluginContext.Log.Error("Get data failed.The error is " + numberOfUsers);
  31.                 return AllUsers;
  32.             }
  33.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement