?? myfiledailog1.cpp
字號:
// MyFileDailog1.cpp : implementation file
//
#include "stdafx.h"
#include "DuanXin.h"
#include "MyFileDailog1.h"
#include "stdio.h"
#include "string.h"
#include "trim.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define TRIM(P) bases_TrimBoth(P)
/////////////////////////////////////////////////////////////////////////////
// CMyFileDailog
IMPLEMENT_DYNAMIC(CMyFileDailog, CFileDialog)
CMyFileDailog::CMyFileDailog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName,
DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
}
BEGIN_MESSAGE_MAP(CMyFileDailog, CFileDialog)
//{{AFX_MSG_MAP(CMyFileDailog)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CMyFileDailog::Ok_Click()
{
FILE *fp;
char File_Path[1024] = "\0" ;
char Read_Txt[1024] ="\0" ;
this->Ok_Click()
{
strcpy(File_Path, ((LPCTSTR) this->GetFileName()));
if(strlen(File_Path)==0)
{
AfxMessageBox("File name is null ");
return ;
}
if((fp=fopen(File_Path,"r"))<0)
{
AfxMessageBox("File Open is error ");
close(fp);
return;
}
else
{
if(fgets(Read_Txt,1024,fp) != NULL)
{
TRIM(Read_Txt);
// Add_Mobile(Read_Txt);
}
}
this->OnOk();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -