void COpticalDlg::OnDblclkUpdatelog()
{
if(MessageBox("Open UpdateLog?","UpdateLog",MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2)==IDYES)
{
//读取版本信息
CString Version;
char ch[10];
memset(ch,0,10);
CFileOperation file1;
file1.OpenFile("data.ini");
file1.ReadData("INFORMATION","Version",ch,10);
//获取当前时间
CTime tm;
tm=CTime::GetCurrentTime();
//时间和版本信息加载到文件中
CString str,str1;
str=tm.Format("\r\n%Y-%m-%d");
int hour=tm.GetHour();
int minute=tm.GetMinute();
int week=tm.GetDayOfWeek();
str1.Format("%d:%d 星期%d",hour,minute,week);
str.Format("%s-%s Version%s\r\n",str,str1,ch);
//打开文件
CFile file("UpateLog.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeReadWrite);
CString FilePath=file.GetFilePath();
//需找文件尾部
file.SeekToEnd();
//写入信息
file.Write(str,strlen(str));
//关闭文件
file.Close();
//打开文件记录信息
ShellExecute(NULL,"open",FilePath,NULL,NULL,SW_SHOWMAXIMIZED);
}