110,534
社区成员
发帖
与我相关
我的任务
分享
int Login( int handle,Login_Info_t* pLoginInfo);
typedef struct tagLoginInfo
{
char szIp[46];
uint32_t nPort;
char szUsername[64];
char szPassword[64];
}Login_Info_t;
[DllImport(dllName, EntryPoint = "DPSDK_Login", CallingConvention = CallingConvention.StdCall)]
public static extern int DPSDK_Login(int dllHandle,ref LoginInfo loginInfo,int timeout=10000);
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public struct LoginInfo
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 46)]
public string ip;
public int port;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public string username;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public string password;
}