1.2 用戶名密碼驗證
VC++ Code:
OnInitDialog方法
MP4_ServerCheckPassword(checkpassWord);
CheckPassWord委托
int CALLBACK checkpassword (char *username,WORD namelen,char *password,Word passlen)
{
/*
if ((username[0] == '1') && (username[1] == '2') && (username[2] == '3') && (passWord[0] == 'w'))
return 0;
else
return -1;
*/
return 0;
}
C# Code:
/// <summary>
/// 驗證用戶名密碼
/// </summary>
/// <param name="username">用戶名</param>
/// <param name="namelen">用戶名長度</param>
/// <param name="passWord">密碼 </param>
/// <param name="passlen">密碼長度</param>
/// <returns></returns>
public int CheckPassword(string username, ushort namelen, string passWord, ushort passlen)
{
//驗證代碼
return 0;
}
這部分和驗證IP差不多,唯一需要注意的是把委托寫成成員變 量!!
二、設置畫面采集質量
從VC++例子中Settings中可以看到這個設置: