readme.wzd

来自「自己多年的收藏」· WZD 代码 · 共 36 行

WZD
36
字号
/////////////////////////////////////////////////////////////////////
// Modify any class...
/////////////////////////////////////////////////////////////////////

// 1) this creates a CMemFile class object and opens the file too
	CMemFile file;

	char buffer[]={"This is my disk data."};

// 2) write to file
	file.Write(buffer,sizeof(buffer));

// 3) get file length
	UINT nBytes = file.GetLength();

// 4) seek to beginning, end and in the middle
	file.SeekToEnd();
	file.Seek(20,CFile::begin); //also CFile::end and CFile::current
	file.SeekToBegin();

// 5) read file
	while (nBytes=file.Read(buffer,sizeof(buffer)))
	{
	}

// 6) delete file (sets to zero length)
//    (file is actually closed when class object is destroyed)
	file.SetLength(0);


/////////////////////////////////////////////////////////////////////
// From: Visual C++ MFC Programming by Example by John E. Swanke
// Copyright (C) 1998 jeswanke. All rights reserved.
/////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?