CommonDialog1.Filter="(*.bin)|*.bin"CommonDialog1.ShowSaveIfCommonDialog1.FileName=""ThenExitSub'//没有选中文件退出过程IfDir(CommonDialog1.FileName)<>""Then'//如果文件已经存在IfMsgbox("文件已经存在,是否要覆盖?",vbYesNo)=vbYseThenGotoSaveFileElseGotoSaveFileEndIfExitSubSaveFile:OpenCommonDialog1.FileNameForBinaryAs#2Fori=0To511Put#2,,arrBuf(i)NextiClose#2