FTP客户端课程设计报告书(6)
CurrentTime.GetMinute(),
CurrentTime.GetSecond());
strTime += \上传出错,请重试\\r\\n\
nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime); return 0; } else {
CurrentTime=CTime::GetCurrentTime(); strTime.Format(\\
CurrentTime.GetDay(),CurrentTime.GetHour(), CurrentTime.GetMinute(),
CurrentTime.GetSecond());
strTime += \文件:\上传成功\
nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime); }
return 1; }
int CFtpOperate::GetMultipleFileName(CStringArray *localNameArray) //localNameArray作为输出参数 {
if (flag != 2) {// 连接未成功 return 0; }
CWaitCursor cursor; BOOL goodfile; int x=0;
int nFileNumber=0;
pFtpConnection->SetCurrentDirectory(m_strFullPath); CFtpFileFind fFiles(pFtpConnection);
goodfile=fFiles.FindFile(m_strFullPath+\ if(goodfile==FALSE) {
fFiles.Close(); return 0; }
CString str; while(goodfile)
第25页
{
goodfile=fFiles.FindNextFile(); str=fFiles.GetFileName(); if(fFiles.IsDirectory()) {
str+=\ }
localNameArray->InsertAt(x,str); nFileNumber++; x++; }
fFiles.Close();
//return the number of missing file, if any. return nFileNumber; }
// 设置服务器下一层文件目录
bool CFtpOperate::setNextPath(CString strPath) {
CString temp = m_strFullPath;
int i = m_strFullPath.GetLength() - 1; if (m_strFullPath.GetAt(i)!='/') {
m_strFullPath +='/'; }
m_strFullPath += strPath + '/';
CurrentTime=CTime::GetCurrentTime(); strTime.Format(\\
CurrentTime.GetDay(),CurrentTime.GetHour(), CurrentTime.GetMinute(),
CurrentTime.GetSecond());
strTime += \当前目录为:\ nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime); return 1; }
// 返回上一层目录
bool CFtpOperate::setBackPath() {
CString str;
pFtpConnection->GetCurrentDirectoryAsURL(str); int i = m_strFullURL.GetLength() - 1; int j = str.GetLength() - 1;
第26页
//AfxMessageBox(str); if (i < j) {
m_strFullPath = str.Right(j - i); }
if (m_strFullPath == '/') {
return 0; } else {
int i = m_strFullPath.GetLength() - 2; // 省略最后的一个‘/’ for (;i>=0;--i) {
if (m_strFullPath.GetAt(i) == '/') {
CString temp;
temp = m_strFullPath.Left(i); m_strFullPath = temp; m_strFullPath +='/';
CurrentTime=CTime::GetCurrentTime(); strTime.Format(\
\.GetHour(), CurrentTime.GetMinute(),CurrentTime.GetSecond()); strTime += \当前目录为:\ nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime); return 1; } } }
return 1; }
// 用temp返回服务器的当前路径
void CFtpOperate::GetPath(CString &temp) {
temp = m_strFullPath; }
// 信息输出的控件句柄传入
void CFtpOperate::setEidt(CEdit *pEdiMessage) {
pEdiMes = pEdiMessage; }
第27页
// 移除,index为0表示移除文件夹,否则为移除文件
int CFtpOperate::DeleteFTPf(CString remote,int index) {
if (flag != 2) {
// 连接未成功 return 0; }
CWaitCursor cursor; // init some var BOOL goodfile; int x=0;
CurrentTime=CTime::GetCurrentTime(); strTime.Format(\\
CurrentTime.GetDay(),CurrentTime.GetHour(), CurrentTime.GetMinute(),
CurrentTime.GetSecond()); if (index == 0) {
strTime += \删除文件夹,请稍候: \ } else {
strTime += \删除文件,请稍候: \ }
nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime);
pFtpConnection->SetCurrentDirectory(m_strFullPath); if (index == 0) {
// 删除文件夹
goodfile = pFtpConnection->RemoveDirectory(m_strFullPath+'/'+remote); } else {
// 删除文件
goodfile = pFtpConnection->Remove(m_strFullPath+'/'+remote); }
if(!goodfile) {
CurrentTime=CTime::GetCurrentTime(); strTime.Format(\
第28页
\
CurrentTime.GetDay(),CurrentTime.GetHour(), CurrentTime.GetMinute(),
CurrentTime.GetSecond());
strTime += \删除失败,请重试\\r\\n\
nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime); return 0; } else {
CurrentTime=CTime::GetCurrentTime(); strTime.Format(\\
CurrentTime.GetDay(),CurrentTime.GetHour(), CurrentTime.GetMinute(),
CurrentTime.GetSecond());
strTime += \删除文件成功:\
nLength = pEdiMes->SendMessage(WM_GETTEXTLENGTH); pEdiMes->SetSel(nLength, nLength); pEdiMes->ReplaceSel(strTime); }
return 1; }
六、测试结果
(1)本地文件列表的显示、各控件不同的选择不会造成出现BUG的测试
(2)连接服务器测试,提示信息测试,不同传输方式测试,不同连接方式测试,是否匿
第29页
…… 此处隐藏:2098字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [综合文档]应答器设备技术规范(征求意见稿)A1
- [综合文档]教师 2012年高考政治试题按考点分类汇
- [综合文档]保险公司的总经理助理竞职演说
- [综合文档]卫生应急大练兵大比武活动考试--题库(
- [综合文档]徐州经济技术开发区总体规划环境影响报
- [综合文档]汉语拼音表(带声调)
- [综合文档]二年级 上 思维训练( 1~18)
- [综合文档]特色学校五年发展规划
- [综合文档]机床经常出现报警“X1轴定位监控”
- [综合文档]《电子技术基础》21.§5—2、3、4 习题
- [综合文档]浙江省深化普通高中课程改革
- [综合文档]CRISP原理 - 图文
- [综合文档]2017年电大社会调查研究与方法形考答案
- [综合文档]浅析建筑施工安全毕业论文
- [综合文档]《回忆我的母亲》名师教案
- [综合文档]装饰装修工程监理规划
- [综合文档]三下乡心得体会-文艺
- [综合文档]柱计算长度系数 - 图文
- [综合文档]全流程思考,提高燃电系统热电转换率--
- [综合文档]2018年嘉定区中考物理一模含答案
- 433M车库门滚动码遥控器
- 8、架空线路施工规范
- 大学四年声乐学习的体会
- 新北师大版五年级数学上册《轴对称再认
- 部编版五年级上册语文第六单元小结复习
- 小学六年级英语形容词用法
- 第2课 抗美援朝保家卫国 课件01(岳麓版
- 2015年天津大学运筹学基础考研真题,考
- 微机计算机控制技术课后于海生(第2版)
- 安全教育实践活动
- Delphi程序设计教程_第1章_Delphi概述
- 第八讲 工业革命与启蒙运动
- 《中华人民共和国药典》2005年版二部勘
- 科粤版九年级化学2.3构成物质的微粒(1)
- 西师大版数学三年级下册《长方形、正方
- ch6_冒泡排序演示
- 第4章 冲裁模具设计
- 浙江中小民营企业员工流失论文[终稿]
- 再议有线数字电视市场营运模式
- 昆明供水工程监理大纲




