用字节数表示
解决方案 »
- 多连接状态下如何区分数据来之哪个链接?
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 如何给运行中的进程传递命令行参数?
- 用户双击某文件时系统怎么来确定用什么程序打开它的?
- 子窗口如何随父窗口的变化?
- List Control
- 请问用VC或C++开发的IE中用的OCX插件,是否能用在windows的胖客户端程序中,比如用在C#的程序中
- MFC非对话框工程,CHtmlView如何去掉滚动条和边框?
- 用MFC开发的ActiveX控件为什么不能在没有安装VC++的机器里注册???
- (菜鸟级问题)学VC++,数学要精辟吗??
- 用teechart的surfaceseries类画出的图不对,但是改成point3D类能画出效果,求大神支招
- 帮帮忙啊!
- Release版本和 Debug版本不一致怎么办呢?
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>void main( void )
{
struct _stat buf;
int result;
char buffer[] = "A line to output"; /* Get data associated with "stat.c": */
result = _stat( "stat.c", &buf ); /* Check if statistics are valid: */
if( result != 0 )
perror( "Problem getting information" );
else
{
/* Output some of the statistics: */
printf( "File size : %ld\n", buf.st_size );
printf( "Drive : %c:\n", buf.st_dev + 'A' );
printf( "Time modified : %s", ctime( &buf.st_atime ) );
}
}
CFile fp = NULL;
TCHAR tcFileName[MAX_PATH];
GetModuleFileName(NULL,tcFileName,MAX_PATH);
(_tcsrchr(tcFileName,'.'))[1] = 0;
lstrcat(tcFileName,_T("pch"));
if(fp.Open(tcFileName, CFile::modeRead|CFile::shareDenyNone|CFile::typeBinary,NULL) == 0)
{
fp.Close();
return;
} llTotalSize = fp.GetLength();
FILE *pFile;
pFile = fopen("路径", "rb");
fseek(pFile,0,SEEK_END);
length=ftell(pFile);
fseek(pFile,0,SEEK_SET);