Public void SetSSRUserInfoToDat (out byte [] DataBuf, int PIN, int Privilege, string Password,
String Name, int Card, int, string TimeZones, string PIN2)
{
DataBuf=new byte [72].
Byte [] PasswordBuf=new byte [8].
Byte [] NameBuf=new byte [24].
Byte [] CardBuf=new byte [4].
Byte [] TimeZonesBuf=new byte [8].
Byte [] PIN2Buf=new byte [24].
SSR_User ssruser=new SSR_User ();
Ssruser. PIN=(ushort) PIN;
Ssruser. Privilege=(byte) Privilege;
PasswordBuf=System. Text. Encoding. The Default. GetBytes (Password);
Array. Copy (PasswordBuf, ssruser. Password, 8).
NameBuf=System. Text. Encoding. The Default. GetBytes (Name);
Array. Copy (NameBuf ssruser. Name, 24).
CardBuf=BitConverter. GetBytes (Card);
Array. Copy (CardBuf, ssruser Card, 4);
Ssruser. Group=(byte) Group;
TimeZonesBuf=System. Text. Encoding. The Default. GetBytes (TimeZones);
Ssruser. TimeZones [0]=(ushort) TimeZonesBuf [0].//been to use timezones or not (0 stands for yes, 1 stands for defining by yourself)
Ssruser. TimeZones [1]=(ushort) TimeZonesBuf [1].//(if you use the timezones) timezoune1
Ssruser. TimeZones [2]=(ushort) TimeZonesBuf [2].//timezone2
Ssruser. TimeZones [3]=(ushort) TimeZonesBuf [3].//timezone3
PIN2Buf=System. Text. Encoding. The Default. GetBytes (PIN2);
Array. Copy (PIN2Buf, ssruser PIN2, 24).
Array. Copy (Raw) RawSerialize (ssruser), DataBuf, 72);
}
CodePudding user response:
The definition of SSR_User structure?CodePudding user response:
The class SSR_User
{
Public ushort PIN;
Public byte Privilege;
[MarshalAs (UnmanagedType ByValArray, SizeConst=8)]
Public byte [] Password=new byte [8].
[MarshalAs (UnmanagedType ByValArray, SizeConst=24)]
Public byte [] Name=new byte [24].
[MarshalAs (UnmanagedType ByValArray, SizeConst=4)]
Public byte [] Card=new byte [4].
Public byte Group;
[MarshalAs (UnmanagedType ByValArray, SizeConst=4)]
Public ushort [] TimeZones=new ushort [4].//the timezones that the user can use the
[MarshalAs (UnmanagedType ByValArray, SizeConst=24)]
Public byte [] PIN2=new byte [24].
}
CodePudding user response:
Give it up SAO years, you might as well just say want to realize what function, then natural someone give you written in Delphi, what translation,CodePudding user response:
Yes, the translation is really bad to do, so I write according to their own ideas to use DEPHI, run like c #, the result of the is done,CodePudding user response:
CodePudding user response:
CodePudding user response:
The original poster had better do some instructions or comments, otherwise I really don't understandCodePudding user response:
Say also some simple point directlyCodePudding user response:
Development kit is an in-process attendance machine, the user information written to the user. The dat file