关于文件操作的几个问题 1。怎样把文件中间一段去掉,紧跟着的部分接上来?2。怎样从一个位置开始写一段,写一字节覆盖原位置的一个字节。3。把一个文件,加到另一个文件中间去(从某位置开始,不覆盖原来的东西)? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CFile ftmp;ftmp.Open(...);ULONGLONG dwLength = ftmp.GetLength();ftmp.Seek(pos+remove_length, CFile::begin);int buflen=dwLength-pos-remove_length;char* pbuf=new char[buflen];if(pbuf){ftmp.Read(pbuf,buflen);}ftmp.SetLength(dwLength-remove_length);ftmp.Seek(pos, CFile::begin);ftmp.Write(pbuf,buflen); it is just a thought, further work is needed in order to make it work. 老大的方法只适合小文件,大文件得用内存映射文件http://expert.csdn.net/Expert/topicview.asp?id=1432612 关于多块网卡的机器指定网卡发送数据是的一个问题 高手们,问一个TCP跟UDP的问题。 各位大侠,十万火急,请都来看看帮小弟一把 消息框跳出两次?? 文本中如何树状写入文件夹下文件名称 如何访问HBITMAP中的图像数据 近日想买个DELL POCKET PC,但不知道它是怎样上网的 关于CString的默认长度? atl开发activex control中的消息循环? 关于类型转换的问题。如何把整型数放到一个CString类型里去 大家分析一下,这是不是微软的一个bug? 送100分啊,这问题看似简单,但就是找不到答案,有高手找到答案解释清楚,就送分
ftmp.Open(...);
ULONGLONG dwLength = ftmp.GetLength();ftmp.Seek(pos+remove_length, CFile::begin);
int buflen=dwLength-pos-remove_length;
char* pbuf=new char[buflen];
if(pbuf)
{
ftmp.Read(pbuf,buflen);
}
ftmp.SetLength(dwLength-remove_length);
ftmp.Seek(pos, CFile::begin);
ftmp.Write(pbuf,buflen);