VC 下载文件显示进度条.rar

时间:2022-07-30 06:20:58
【文件属性】:
文件名称:VC 下载文件显示进度条.rar
文件大小:21KB
文件格式:RAR
更新时间:2022-07-30 06:20:58
VC 源码-系统相关 VC 下载文件显示进度条,pwnd->GetDlgItemText(IDC_EDIT1,szFile);   pwnd->SetDlgItemText(IDC_STAT,"正在校验下载地址...");   fTargFile = netSession.OpenURL(szFile,1,INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_RELOAD);   nDownloaded = 1;   COleDateTime dlStart = COleDateTime::GetCurrentTime();   int filesize = fTargFile->SeekToEnd();   fTargFile->SeekToBegin();   outfs = filesize / 1024;// 计算文件大小(千字节)   FileSize.Format("%d",outfs);// 以KB为单位格式文件大小   // 在当前目录创建新的目标文件   CFile fDestFile(fTargFile->GetFileName(), CFile::modeCreate | CFile::modeWrite | CFile::typeBinary);   int byteswrite; // 写入文件的字节数   int pos = 0;// 当前进度条的位置   int nperc,kbrecv;// 进度条的百分比,获取到的数据大小(Kbs为单位)   double secs,kbsec;// 记录秒数, 速度(KB/秒)   // 如果文件名太长,缩短窗口的标题并在状态显示   NewName = fTargFile->GetFileName(); // 获取新文件名   if(fTargFile->GetFileName().GetLength() >= 10)   {    NewName = fTargFile->GetFileName().Mid(0,7);// 分割文件    NewName = NewName "...";   }
【文件预览】:
codesc.net
----DownProgress()
--------Down.cpp(2KB)
--------Resource.h(1KB)
--------Down.aps(21KB)
--------res()
--------Down.rc(6KB)
--------DownDlg.cpp(9KB)
--------Down.clw(1KB)
--------Down.h(1KB)
--------Down.dsp(4KB)
--------StdAfx.cpp(206B)
--------Down.dsw(533B)
--------StdAfx.h(1KB)
--------DownDlg.h(1KB)
--------ReadMe.txt(3KB)

网友评论