void CBandfileDlg::OnBandFile() { // TODO: Add your control notification handler code here CString filename; int filenum = 0; int headoffset; int fileoffset; int filelen; int filenamelen; FILE *fp; CFile file; char *buff; char fileflag[5] = "LICH";
void CPackDlg::OnBtnPack() { // TODO: Add your control notification handler code here CFileDialog savedlg(FALSE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"(类型:*.free)|*.free||"); if (IDOK != savedlg.DoModal()) return; int nTimeBegin = time(NU
#建立一个222.rb文件并且输入字符
file = File.open(222.rb,w+)
file.puts 123\nwadwa\n12124124\ndwdw
file.close
#输出222.rb的内容
File.open(222.rb,r+) do |file|
while line = file.gets
puts line
end
end
#直接用IO操作文件
IO.foreach(222.rb) do |line|
puts line if line =~/abc/ #输出