|
原帖由 云层 于 2010-7-19 12:03 发表
那么你可以试试直接拼接Target_path整个字符串,一般就可以了
是可以的。
程序是:
unsigned long *ftp_session1=NULL;
char source_dir[200], S[250];
char dest_dir[200], D[250];
char *directorys="d:\\R710\\data\\";
char *directoryd="/0/000/000/";
int s,d;
char temps[60];
char tempd[60];
char x[10] , y[10];
ftp_logon_ex(&ftp_session1,"FTP","URL=ftp://zl:zl@129.22.145.200", LAST);
s=rand()%5;
d=(rand()%899)+100;
if (!itoa(s, temps, 10))
lr_output_message("Cannot convert i to ascii char");
else {
//sprintf(source_dir,"%s", directorys);
sprintf (source_dir, "%s%s", directorys, temps);
lr_output_message("Source file name %s", source_dir);
}
if (!itoa(d, tempd, 10))
lr_output_message("Cannot convert i to ascii char");
else {
//sprintf(source_dir,"%s", directorys);
sprintf (dest_dir, "%s%s", directoryd, tempd);
lr_output_message("Dest file name %s", dest_dir);
}
sprintf (S, "SOURCE_PATH=%s", source_dir);
sprintf (D, "TARGET_PATH=%s", dest_dir);
lr_output_message(source_dir);
lr_output_message(dest_dir);
ftp_put_ex(&ftp_session1,"Ftp_Put","%s",S, "%s",D,"MODE=ASCII", "PASSIVE=TRUE",ENDITEM , LAST);
[ 本帖最后由 zenglei 于 2010-7-19 15:17 编辑 ] |
|