www.pudn.com > SafeClean.rar > LogFiles.cpp


// LogFiles.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "SafeClean.h" 
#include "LogFiles.h" 
#include "stdio.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
int Files,Size,TFiles,TSize; 
FILE *show,*showall; 
///////////////////////////////////////////////////////////////////////////// 
// LogFiles dialog 
 
 
LogFiles::LogFiles(CWnd* pParent /*=NULL*/) 
	: CDialog(LogFiles::IDD, pParent) 
{ 
	 
	//{{AFX_DATA_INIT(LogFiles) 
    m_cfiles = _T(""); 
	m_cspace = _T(""); 
	m_tfiles = _T(""); 
	m_tspace = _T(""); 
	 
	//}}AFX_DATA_INIT 
 
    show = fopen("c:\\Temp\\flogview.ini","r"); 
	if(show==NULL){AfxMessageBox("Log Failed");exit(0);} 
	fscanf(show,"%d %d",&Files,&Size); 
	showall=fopen("c:\\Temp\\tlogview.ini","r"); 
	if(showall==NULL){AfxMessageBox("Log Failed");exit(0);} 
    fscanf(showall,"%d %d",&TFiles,&TSize); 
 
	m_cfiles.Format("%d",Files);  
	m_cfiles.Format("%d",Files); 
	m_cspace.Format("%d kb",Size); 
	m_cspace.Format("%d kb",Size/1024); 
 
	m_tfiles.Format("%d",TFiles);  
	m_tfiles.Format("%d",TFiles); 
	m_tspace.Format("%d Mb",TSize); 
	m_tspace.Format("%d kb",(TSize/(1024))); 
	fclose(show); 
 
	 
} 
 
 
void LogFiles::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(LogFiles) 
	DDX_Text(pDX, IDC_CFILES, m_cfiles); 
	DDX_Text(pDX, IDC_CSPACE, m_cspace); 
	DDX_Text(pDX, IDC_TFILES, m_tfiles); 
	DDX_Text(pDX, IDC_TSPACE, m_tspace); 
	//}}AFX_DATA_MAP 
 
 
	 
} 
 
 
BEGIN_MESSAGE_MAP(LogFiles, CDialog) 
	//{{AFX_MSG_MAP(LogFiles) 
	ON_BN_CLICKED(ID_CLEAR, OnClear) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// LogFiles message handlers 
 
void LogFiles::OnCancel()  
{ 
	// TODO: Add extra cleanup here 
	 
	CDialog::OnCancel(); 
} 
 
void LogFiles::OnClear()  
{ 
	// TODO: Add your control notification handler code here 
	fcloseall(); 
	int x=0,y=0; 
    show=fopen("c:\\Temp\\tlogview.ini","w+"); 
	if(show==NULL){AfxMessageBox("             ERROR! \n It seems that you have not installed this product on c drive.\n Install/ReInstall the product on C-Drive only as is.   \n    Else mail the author for other reason. ");fcloseall();exit(0);} 
	fprintf(show,"%d %d",x,y); 
	m_tfiles.Format("%d",x);  
	m_tfiles.Format("%d",x); 
	 
	m_tspace.Format("%d Mb",y); 
	m_tspace.Format("%d kb",y); 
	UpdateData(FALSE); 
	fcloseall(); 
	 
}