|
不懂C++,尝试着登录FTP,下面是我本地代码,希望得到一点指导!
仍然返回参数不合法:
int BVCU_Login_Helper::FTP_Login(BVCU_FTP_HSession* phSession, char* szID, char* serverIp,
int serverPort, char* usrName, char* usrPsw, int timeOutSec)
{
BVCU_FTP_ServerParam cmd;
memset(&cmd, 0, sizeof(cmd));
cmd.iSize = sizeof(cmd);
strcpy_s(cmd.szServerAddr, sizeof(cmd.szServerAddr), serverIp);
cmd.iServerPort = serverPort;
cmd.iKeepAliveInterval = 0;
cmd.OnEvent = login_roback;
strcpy_s(cmd.szID, sizeof(cmd.szID), szID);
//memset(cmd.szUserName, '\0', sizeof(cmd.szUserName));
//memset(cmd.szPassword, '\0', sizeof(cmd.szPassword));
cmd.iTimeOut = timeOutSec * 1000;
return BVCU_FTP_Login(phSession,&cmd);
}
IntPtr FTPsession= IntPtr.Zero;
IntPtr ip = Marshal.StringToHGlobalAnsi("xxx.xxx.xxx.xx");
IntPtr account = IntPtr.Zero;//Encoding.UTF8.GetBytes("admin");
IntPtr password = IntPtr.Zero;// Encoding.GetBytes("123456");
IntPtr szid= Marshal.StringToHGlobalAnsi("NRU_005056BFDA69");
var login = SDK_Helper.FTP_Login(ref FTPsession, szid, ip, 29701, account, password, 100 * 1000); |
|