字符串构造及WriteString()发送空消息解决思路

字符串构造及WriteString()发送空消息
void CFtpclient::Send(CString charstring)
{
CSocketFile *socketfile;
socketfile=new CSocketFile(m_clientsocket);
archive=new CArchive(m_socketfile,CArchive::load|CArchive::store);

charstring=" "USER"+lymlrl+"PASS"+123456 ";

archive.WriteString(" "+"\r\n");

try{
archive->WriteString(charstring+"\r\n");
archive->Flush();
}

catch(CException e)
{
AfxMessageBox("发送关闭命令失败!");
}
}
1.charstring=" "USER"+lymlrl+"PASS"+123456 ";这个构造有错,如何改?
2.archive.WriteString(" "+"\r\n");这个有错,如何发送一个空消息?



------解决方案--------------------
1 charstring="USER"+lymlrl+"PASS"+"123456"; 
2 archive.WriteString("\r\n"); 这样就是一个空字符串了

------解决方案--------------------
你这句代码中的双引号太乱了
既然charstring是CString
那用Format来构造吧
相关资料http://wenku.baidu.com/view/dd04db2c7375a417866f8f36.html
------解决方案--------------------
charstring= " "USER"+lymlrl+"PASS"+123456 ";
CString 只能一个一个加“xxx”,因为2个‘xxx’+‘yyy’是不能加的。
------解决方案--------------------
探讨
还是不行啊 !!!错误显示如下:
error C2065: 'lymlrl' : undeclared identifier
error C2110: cannot add two pointers
error C2228: left of '.WriteString' must have class/struct/union type
如果charstring="USER"+"lymlr……

------解决方案--------------------
探讨
引用:
引用:
还是不行啊 !!!错误显示如下:
error C2065: 'lymlrl' : undeclared identifier
error C2110: cannot add two pointers
error C2228: left of '.WriteString' must have class/struct/union type
……

------解决方案--------------------
你这个基本上是语法错误了,建议多用几个短语句联合吧