C/C++ code
#define MAX_STRM_LAYER 3 // 最多几级流媒体//服务器信息typedef struct tagServerInfo{
long uID;
char csStrMIP[MAX_STRM_LAYER][16]; // 这个不知道如何转换
unsigned short nStrMPort[MAX_STRM_LAYER];
char csDdtIP[16];
unsigned short nDdtPort;
unsigned short bIsWebUser;
unsigned short protocolType;
constchar*pcUserName;
constchar*pcPassword;
char csStoreFileSvrIP[16];
unsigned short nStoreFileSvrPort;
char csDevFileSvrIP[16];
unsigned short nDevFileSvrPort;
}TServerInfo, *LPServerInfo;
LONG __stdcall StrM_Login(LPServerInfo mts, int iLayer =1);
C#code
///<summary>
/// 最多几级流媒体
///</summary>
public const int MAX_STRM_LAYER =3;
///<summary>
/// 服务器信息
/// </summary>
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct TServerInfo
{
public int uID;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst =3*16)]
public char[] csStrMIP;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst =3)]
public ushort[] nStrMPort;
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst =16)]
public string csDdtIP;
public ushort nDdtPort;
public ushort bIsWebUser;
public ushort protocolType;
public string pcUserName;
public string pcPassword;
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst =16)]
public string csStoreFileSvrIP;
public ushort nStoreFileSvrPort;
[MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst =16)]
public string csDevFileSvrIP;
public ushort nDevFileSvrPort;
}
[DllImport("StreamMedia.dll")]
public static extern int StrM_Login(ref TServerInfo mts, int iLayer);