|
程序片断如下:
c语言的.在cygwin环境下写的.
[PHP]
int Login ()
{
char user[] = "anonymous";
char pass[] = "someone@21cn.com";
strcpy (sbuf, "USER ");
strcat (sbuf, user);
printf (sbuf);
strcat (sbuf, "\r\n");
send (cmd_sock, sbuf, strlen (sbuf), 0);
recv (cmd_sock, rbuf, sizeof (rbuf), 0);
printf (rbuf);
if (CheckReplycode (rbuf, "331") != 0)
return -1;
memset (rbuf, 0, sizeof (rbuf));
strcpy (sbuf, " ASS ");
strcat (sbuf, pass);
printf (sbuf);
strcat (sbuf, "\r\n");
send (cmd_sock, sbuf, strlen (sbuf), 0);
recv (cmd_sock, rbuf, sizeof (rbuf), 0);
printf (rbuf);
if (CheckReplycode (rbuf, "230") != 0)
return -1;
memset (rbuf, 0, sizeof (rbuf));
return 1;
}
[/PHP]
现在问题是.正常的登录的话应该显示出
230-***************************************************************
230-
230- Welcome to ftp.intel.com!
230-
230- For Intel product questions/comments/requests, please send mail to
230-
230- support@mailbox.intel.com
230-
230- For issues or problems with this FTP Server, please send mail to
230-
230- ftp-admin@intel.com
230-
230-
230- *************** PLEASE READ *************************
230-
230- Use of this system by unauthorized persons or in an
230- unauthorized manner is strictly prohibited. Unauthorized
230- access can and will be prosecuted to the fullest extent
230- possible.
230-
230- Intel Internet File Exchange - One way exchange
230- Please note that external users will only be able to
230- download files from the /pub/outgoing area, and upload data
230- in the /pub/incoming areas in the public exchange areas.
230- Intel users will only be able to download from the
230- /pub/incoming directory, and upload to /pub/outgoing.
230-
230- **********************************************************
230- *** Please encrypt and compress all files before ***
230- *** uploading them to the server. ***
230- **********************************************************
230-
230-***************************************************************
230-
230 Guest login ok, access restrictions apply.
但是我的程序只显示出了第一行.不知怎么解决呢?
第一次碰socket没有任何经验....从早上一直弄到现在. |
|