?? nxxxxx_killdoc.cpp
字號:
// Nxxxxx_killDoc.cpp : implementation of the CNxxxxx_killDoc class
//
#include "stdafx.h"
#include "Nxxxxx_kill.h"
#include "Nxxxxx_killDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNxxxxx_killDoc
IMPLEMENT_DYNCREATE(CNxxxxx_killDoc, CDocument)
BEGIN_MESSAGE_MAP(CNxxxxx_killDoc, CDocument)
//{{AFX_MSG_MAP(CNxxxxx_killDoc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNxxxxx_killDoc construction/destruction
CNxxxxx_killDoc::CNxxxxx_killDoc()
{
// TODO: add one-time construction code here
str_26A = _T("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
str_26a = _T("abcdefghijklmnopqrstuvwxyz");
}
CNxxxxx_killDoc::~CNxxxxx_killDoc()
{
}
BOOL CNxxxxx_killDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CNxxxxx_killDoc serialization
void CNxxxxx_killDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CNxxxxx_killDoc diagnostics
#ifdef _DEBUG
void CNxxxxx_killDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CNxxxxx_killDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNxxxxx_killDoc commands
BOOL CNxxxxx_killDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
// TODO: Add your specialized creation code here
str_filepath = lpszPathName;
OnChange();
return TRUE;
}
void CNxxxxx_killDoc::OnChange()
{
FILE *file,*file2;
if(!(file=fopen(str_filepath,"r"))){
AfxMessageBox("不能打開指定文件!",MB_OK);
exit(1);
}
//CString str2;
str2.Empty();
str2 = str2 + str_filepath + "0";
if(!(file2=fopen(str2,"w+"))){
AfxMessageBox("不能創建指定目標文件!",MB_OK);
exit(1);
}
CString str;
char ch[256];
str = _T("");
BeginWaitCursor();
while(!feof(file)){
fscanf(file,"%s",ch);
str = str + ch;
for(int i = 0;i < str.GetLength();i++){
for(int j = 0;j<26;j++){
//*
if(str.GetAt(i) !='N'){
if(str.GetAt(i) == str_26A.GetAt(j)){
str.Delete(0,i);
goto Loop;
}
}
//*/
}
}
Loop:
fprintf(file2,"%s\n",str);
str.Empty();
str_filepath.Empty();
}
EndWaitCursor();
fclose(file);
fclose(file2);
str2 = "N行號剔除已完成!\n保存路徑為:\n" + str2;
AfxMessageBox(str2,MB_OK);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -