📄 subject_17460.htm
字号:
<p>
序号:17460 发表者:lirui 发表日期:2002-10-11 15:58:01
<br>主题:求救!SOS!Help me!
<br>内容:我有一数据记录“10220000270000 099999999999999 2002/10/0900:00:5500:01:3100:01:36 JP 999999999999999 000008eXN30000 V1 09999999999 09999999999193#”是文本格式的(*.log)。<BR><BR>现要求<BR>The format of the time is<BR>YYYY/MM/DDHH:MM:SSHH:MM:SSHH:MM:SS<BR>The first HH:MM:SS is user call in time<BR>The second HH:MM:SS is user connect time<BR>The Third HH:MM:SS is user disconnect time<BR><BR>I want to know for each minutes in a day, how many channels is occupied.<BR>One record means 1 channel occupoied. One day has 1440 minute<BR><BR>Please help me to produce a output like that<BR>Minute 0 1 2 3 4 ....... 1440<BR>No of channel occupied X X ............. X
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:李兰 回复日期:2002-10-11 16:02:08
<br>内容:看不懂你的暗语,把题目说说清嘛。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:黄飚 回复日期:2002-10-11 16:04:45
<br>内容:1111// DICOMLogIF.cpp: implementation of the CDICOMLogIF class.<BR>//<BR>//////////////////////////////////////////////////////////////////////<BR><BR>#include "DICOMLogIF.h"<BR><BR>//////////////////////////////////////////////////////////////////////<BR>// Construction/Destruction<BR>CDICOMLogIF *CDICOMLogIF::pThis=NULL;<BR>CString strLogType[]={_T("Warning"),_T("Information"),_T("Success"),_T("Failure")};<BR>/* DICOMLOG_WARNING_TYPE,<BR> DICOMLOG_INFORMATION_TYPE,<BR> DICOMLOG_SUCESS_TYPE,<BR> DICOMLOG_FAILURE_TYPE}DICOM_LOG_TYPE;<BR> */<BR>void CDICOMLogIF::CreateInstance()<BR>{<BR><BR> if(pThis==NULL)<BR> {<BR><BR> pThis=new CDICOMLogIF(DICOM_ARCHIVE);<BR> <BR> }<BR> char strPath[MAX_PATH];<BR> GetCurrentDirectory(MAX_PATH,strPath);<BR> <BR> <BR> <BR><BR>}<BR>void CDICOMLogIF::Destroy()<BR>{<BR><BR> if(NULL!=pThis)<BR> {<BR><BR> delete pThis;<BR> pThis=NULL;<BR> <BR> }<BR>}<BR>CDICOMLogIF *CDICOMLogIF::GetInstance()<BR>{<BR><BR><BR> return pThis;<BR><BR>}<BR>CDICOMLogIF::CDICOMLogIF(DICOM_LOGTYPE eLogType)<BR>{<BR> m_eLogType=eLogType;<BR> m_strLogFileName=GetlogFileName(eLogType);<BR> OpenLogFile();<BR>}<BR><BR>CDICOMLogIF::~CDICOMLogIF()<BR>{<BR> CloseLogFile();<BR><BR>}<BR><BR>void CDICOMLogIF::AddLog(CLogMessage &LogMessage)<BR>{<BR> CTime t = CTime::GetCurrentTime();<BR> CString sTemp;<BR> sTemp.Format(_T(" %s : %s\r\n"), <BR> (LPCTSTR)t.Format(_T("%Y.%m.%d %H:%M:%S")), LogMessage);<BR> WriteLog(sTemp);<BR><BR>}<BR>void CDICOMLogIF::AddLog(CString &strLogMessage)<BR>{<BR><BR> CTime t = CTime::GetCurrentTime();<BR> CString sTemp;<BR> sTemp.Format(_T(" %s : %s\r\n"), <BR> (LPCTSTR)t.Format(_T("%Y.%m.%d %H:%M:%S")),strLogMessage);<BR> WriteLog(sTemp);<BR><BR><BR>}<BR>void CDICOMLogIF::AddLogEx(CString &strLogMessage,DICOM_LOG_TYPE eLogType)<BR>{<BR><BR> <BR> CTime t = CTime::GetCurrentTime();<BR> CString sTemp;<BR><BR><BR><BR> sTemp.Format(_T(" %s : %8s : %s\r\n"), <BR> (LPCTSTR)t.Format(_T("%Y.%m.%d %H:%M:%S")),strLogType[eLogType],strLogMessage);<BR> WriteLog(sTemp);<BR><BR><BR>}<BR>void CDICOMLogIF::AddLogSateEx(CString &strLogMessage,DICOM_LOG_STATE eLogType)<BR>{<BR><BR> <BR> CTime t = CTime::GetCurrentTime();<BR> CString sTemp;<BR><BR><BR><BR> sTemp.Format(_T("%d %s : %s\r\n"), eLogType,<BR> (LPCTSTR)t.Format(_T("%Y.%m.%d %H:%M:%S")),strLogMessage);<BR> WriteLog(sTemp);<BR><BR><BR>}<BR>CList<CLogMessage,CLogMessage &>*CDICOMLogIF::GetLog()<BR>{<BR><BR><BR> return &m_ListLog;<BR><BR>}<BR>CString CDICOMLogIF::GetlogFileName(DICOM_LOGTYPE eLogType)<BR>{<BR> eLogType;<BR> CString strFileName; <BR> strFileName=_T("c:\\dicom.log");<BR> return strFileName;<BR><BR><BR>}<BR><BR>void CDICOMLogIF::OpenLogFile()<BR>{<BR> CFileFind tempFindFile;<BR> CFileException e; <BR> if(0==tempFindFile.FindFile(m_strLogFileName))<BR> {<BR> if(!fLog.Open((LPCSTR)m_strLogFileName,CFile::modeCreate |CFile::shareDenyNone|CFile::modeWrite,&e ))<BR> {<BR> #ifdef _DEBUG<BR> afxDump << "File could not be opened " << e.m_cause << "\n";<BR> #endif<BR> }<BR> }<BR> else<BR> { <BR> if(!fLog.Open((LPCSTR)m_strLogFileName,CFile::shareDenyNone|CFile::modeWrite,&e ))<BR> {<BR> #ifdef _DEBUG<BR> afxDump << "File could not be opened " << e.m_cause << "\n";<BR> #endif<BR> }<BR> }<BR>}<BR><BR>void CDICOMLogIF::CloseLogFile()<BR>{<BR> fLog.Close();<BR> <BR>}<BR><BR>void CDICOMLogIF::WriteLog(CString &strLogMessage)<BR>{<BR> fLog.SeekToEnd();<BR> fLog.Write(strLogMessage,strLogMessage.GetLength());<BR> <BR>}<BR><BR><BR><BR>void CLogMessage::CString2LogMessage(CString &strLogMessage)<BR>{<BR> strLogMessage.TrimLeft();<BR> strLogMessage.TrimRight();<BR> //m_eLogState=atoi(strLogMessage.Left(0));<BR> try<BR> {<BR> m_strDate=strLogMessage.Mid(0,11);<BR> m_strTime=strLogMessage.Mid(11,8);<BR> m_strMessage=strLogMessage.Mid(22,256);<BR> }<BR> catch(CMemoryException &e)<BR> {<BR> e;<BR> return;<BR><BR> }<BR> m_strMessage.TrimLeft();<BR> m_strMessage.TrimRight();<BR><BR>}<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:lirui 回复日期:2002-10-11 16:09:19
<br>内容:黄飚,你能告诉我怎样运行吗。需要用vc++新建一个projects吗?<BR><BR>另外,你为什么这么快就把这么长的代码写出来???
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄飚 回复日期:2002-10-11 17:32:53
<br>内容:因为我干过这事
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:lirui 回复日期:2002-10-11 17:37:08
<br>内容:黄飚,你能告诉我怎样运行吗?(在vc里面),thanks!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:lirui 回复日期:2002-10-11 18:07:53
<br>内容:黄飚,你能告诉我怎样运行吗?(在vc里面),thanks!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:黄飚 回复日期:2002-10-11 18:48:40
<br>内容:给你的是.cpp,你把其中格式化写文件用到你项目里去就可以了,不要另外开贴子叫我了,自己动动手,谢谢!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:高扬 回复日期:2002-10-11 22:27:09
<br>内容:STL<BR>黄飚 :哈哈,你这人好好玩啊,好变态的一个人 ,哈哈哈哈 !
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -