9512.net
甜梦文库
当前位置:首页 >> 学科竞赛 >>

C源码


C 源码==>> Part One #if !defined(AFXGsi_WDLBIEDLGGsi_HGsi_Gsi_C175C508Gsi_0123Gsi_4730Gsi_BBAFGsi _82B3479AC9A2Gsi_Gsi_INCLUDEDGsi_) #define AFXGsi_WDLBIEDLGGsi_HGsi_Gsi_C175C508Gsi_0123Gsi_4730Gsi_BBAFGsi_82B3479A C9A2Gsi_Gsi_INCLUDEDGsi_ #include "Zdmlb.h" #include "Zdxxb.h" #include "Rizhib.h" #include "Users.h" #include "Dwxxb.h" #if Gsi_MSCGsi_VER > 1000 #pragma once #endif Gsi_MSCGsi_VER > 1000 Wdlbiedlg.h : header file extern CUsers user; CWdlbiedlg dialog class CWdlbiedlg : public CDialog { Construction public: CWdlbiedlg(CWnd pParent = NULL); standard constructor CTime t; CRizhib zhi; Dialog Data {{AFXGsi_DATA(CWdlbiedlg) enum { IDD = IDDGsi_WDLB }; intmGsi_dwbh; intmGsi_lbbh; CStringmGsi_lbmc; }}AFXGsi_DATA Overrides ClassWizard generated virtual function overrides {{AFXGsi_VIRTUAL(CWdlbiedlg) public: virtual BOOL PreTranslateMessage(MSG pMsg); protected: virtual void DoDataExchange(CDataExchange pDX); DDXDDV support }}AFXGsi_VIRTUAL Implementation protected: HICON mGsi_hIcon; Generated message map functions {{AFXGsi_MSG(CWdlbiedlg)

virtual void OnOK(); afxGsi_msg void OnModbutton(); afxGsi_msg void OnDelbutton(); virtual BOOL OnInitDialog(); }}AFXGsi_MSG DECLAREGsi_MESSAGEGsi_MAP() }; {{AFXGsi_INSERTGsi_LOCATION}} Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFXGsi_WDLBIEDLGGsi_HGsi_Gsi_C175C508Gsi_0123Gsi_4730Gsi_BBA FGsi_82B3479AC9A2Gsi_Gsi_INCLUDEDGsi_) C 源码==>> Part Two #include "TabKH.h" #if !defined(AFXGsi_DLGKHGsi_HGsi_Gsi_50A34F4FGsi_BB29Gsi_43F3Gsi_95A6Gsi_61D5 FBEACA00Gsi_Gsi_INCLUDEDGsi_) #define AFXGsi_DLGKHGsi_HGsi_Gsi_50A34F4FGsi_BB29Gsi_43F3Gsi_95A6Gsi_61D5FBEACA00 Gsi_Gsi_INCLUDEDGsi_ #if Gsi_MSCGsi_VER > 1000 #pragma once #endif Gsi_MSCGsi_VER > 1000 DlgKH.h : header file CDlgKH dialog class CDlgKH : public CDialog { Construction public: virtual BOOL DestroyWindow(); CDlgKH(CWnd pParent = NULL); standard constructor Dialog Data {{AFXGsi_DATA(CDlgKH) enum { IDD = IDDGsi_DIALOGGsi_KH }; NOTE: the ClassWizard will add data members here }}AFXGsi_DATA CTabKHmGsi_tabKh; Overrides ClassWizard generated virtual function overrides {{AFXGsi_VIRTUAL(CDlgKH) protected: virtual void DoDataExchange(CDataExchange pDX); DDXDDV support }}AFXGsi_VIRTUAL Implementation protected:

Generated message map functions {{AFXGsi_MSG(CDlgKH) virtual void OnOK(); virtual BOOL OnInitDialog(); }}AFXGsi_MSG DECLAREGsi_MESSAGEGsi_MAP() }; {{AFXGsi_INSERTGsi_LOCATION}} Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFXGsi_DLGKHGsi_HGsi_Gsi_50A34F4FGsi_BB29Gsi_43F3Gsi_95A6Gsi_ 61D5FBEACA00Gsi_Gsi_INCLUDEDGsi_) C 源码==>> Part Three #if !defined(AFXGsi_SETROOMDLGGsi_HGsi_Gsi_623EC99DGsi_23FBGsi_4385Gsi_84E8G si_75BFE733FDF2Gsi_Gsi_INCLUDEDGsi_) #define AFXGsi_SETROOMDLGGsi_HGsi_Gsi_623EC99DGsi_23FBGsi_4385Gsi_84E8Gsi_75BFE73 3FDF2Gsi_Gsi_INCLUDEDGsi_ #include "Roominfoset.h" #include "TETSET.h" #if Gsi_MSCGsi_VER > 1000 #pragma once #endif Gsi_MSCGsi_VER > 1000 Setroomdlg.h : header file CSetroomdlg dialog class CSetroomdlg : public CDialog { Construction public: CSetroomdlg(CWnd pParent = NULL); standard constructor CRoominfoset mysetroomset; CTETSET MYTESTSET; void enable(bool bEnabled); 定义 ADO 连接、命令、记录集变量指针 Gsi_ConnectionPtrmGsi_pConnection; Gsi_CommandPtrmGsi_pCommand; Gsi_RecordsetPtrmGsi_pRecordset; CString showroomGsi_roomnumber; CString showroomGsi_roomlevel; CString showroomGsi_roommoney; CString showroomGsi_roomstate; CString showroomGsi_roomsign; CString showroomGsi_roombeizhu; CString showroomGsi_roomsetting;

CString showroomGsi_roomusesetting; CString showroomGsi_roomusedate; Dialog Data {{AFXGsi_DATA(CSetroomdlg) enum { IDD = IDDGsi_DIGGsi_setroom }; CListCtrlmGsi_setroomdlgGsi_list; CStringmGsi_roomnumber; CStringmGsi_roomset; CStringmGsi_roomGsi_usesetting; CStringmGsi_roommoney; CStringmGsi_roomlevel; CStringmGsi_roomstate; CTimemGsi_roomGsi_usetime; CStringmGsi_beizhu; }}AFXGsi_DATA Overrides ClassWizard generated virtual function overrides {{AFXGsi_VIRTUAL(CSetroomdlg) public: virtual BOOL PreTranslateMessage(MSG pMsg); protected: virtual void DoDataExchange(CDataExchange pDX); DDXDDV support }}AFXGsi_VIRTUAL Implementation protected: Generated message map functions {{AFXGsi_MSG(CSetroomdlg) virtual void OnOK(); virtual BOOL OnInitDialog(); afxGsi_msg void Onbeginsetroom(); afxGsi_msg void Onsetroom(); }}AFXGsi_MSG DECLAREGsi_MESSAGEGsi_MAP() }; {{AFXGsi_INSERTGsi_LOCATION}} Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif !defined(AFXGsi_SETROOMDLGGsi_HGsi_Gsi_623EC99DGsi_23FBGsi_4385Gsi_8 4E8Gsi_75BFE733FDF2Gsi_Gsi_INCLUDEDGsi_) C 源码==>> Part Four MyPrintView.cpp : implementation file #include "stdafx.h" #include "a1.h" #include "MyPrintView.h"

#ifdef Gsi_DEBUG #define new DEBUGGsi_NEW #undef THISGsi_FILE static char THISGsi_FILE[] = Gsi_Gsi_FILEGsi_Gsi_; #endif CMyPrintView IMPLEMENTGsi_DYNCREATE(CMyPrintView, CView) CMyPrintView::CMyPrintView() { } CMyPrintView::~CMyPrintView() { } BEGINGsi_MESSAGEGsi_MAP(CMyPrintView, CView) {{AFXGsi_MSGGsi_MAP(CMyPrintView) NOTE - the ClassWizard will add and remove mapping macros here. }}AFXGsi_MSGGsi_MAP ENDGsi_MESSAGEGsi_MAP() CMyPrintView drawing void CMyPrintView::OnDraw(CDC pDC) { CDocument pDoc = GetDocument(); pDC->TextOut(0,0,"werwerwre"); } CMyPrintView diagnostics #ifdef Gsi_DEBUG void CMyPrintView::AssertValid() const { CView::AssertValid(); } void CMyPrintView::Dump(CDumpContext& dc) const { CView::Dump(dc); } #endif Gsi_DEBUG CMyPrintView message handlers C 源码==>> Part Five DRegedit.cpp : implementation file #include "stdafx.h" #include "MyProject.h" #include "DRegedit.h" #include "DLogin.h"

#include "Math.h" #ifdef Gsi_DEBUG #define new DEBUGGsi_NEW #undef THISGsi_FILE static char THISGsi_FILE[] = Gsi_Gsi_FILEGsi_Gsi_; #endif CDRegedit dialog CDRegedit::CDRegedit(CWnd pParent =NULL) : CDialog(CDRegedit::IDD, pParent) { {{AFXGsi_DATAGsi_INIT(CDRegedit) NOTE: the ClassWizard will add member initialization here }}AFXGsi_DATAGsi_INIT } void CDRegedit::DoDataExchange(CDataExchange pDX) { CDialog::DoDataExchange(pDX); {{AFXGsi_DATAGsi_MAP(CDRegedit) DDXGsi_Control(pDX, IDCGsi_BUTTRY, mGsi_ButTry); DDXGsi_Control(pDX, IDCGsi_EDTCODE, mGsi_EdtCode); DDXGsi_Control(pDX, IDCGsi_EDTUSERNAME, mGsi_EdtUserName); }}AFXGsi_DATAGsi_MAP } BEGINGsi_MESSAGEGsi_MAP(CDRegedit, CDialog) {{AFXGsi_MSGGsi_MAP(CDRegedit) ONGsi_BNGsi_CLICKED(IDCGsi_BUTHERE, OnButhere) ONGsi_BNGsi_CLICKED(IDCGsi_BUTREG, OnButreg) ONGsi_BNGsi_CLICKED(IDCGsi_BUTTRY, OnButtry) ONGsi_BNGsi_CLICKED(IDCGsi_BUTEXIT, OnButexit) }}AFXGsi_MSGGsi_MAP ENDGsi_MESSAGEGsi_MAP() CDRegedit message handlers void CDRegedit::OnOK() { TODO: Add extra validation here CDialog::OnOK(); } void CDRegedit::OnCancel() { TODO: Add extra cleanup here CDialog::OnCancel(); }

void CDRegedit::OnButhere() { CString sUserName; mGsi_EdtUserName.GetWindowText(sUserName); if(sUserName.IsEmpty()) { MessageBox("请输入用户名!","系统提示",MBGsi_OK|MBGsi_ICONSTOP); this->mGsi_EdtUserName.SetFocus(); } CString sSerialNumber; sSerialNumber.Format("%d",mGsi_VolumnSerialNumber^1234567890123); CFileDialog dlg(false,"注册.RXI","注册.RXI", OFNGsi_HIDEREADONLY | OFNGsi_OVERWRITEPROMPT,"注册文件|.RXI|"); dlg.DoModal(); CString sFile=dlg.GetPathName(); if(sFile.IsEmpty()) return; 写入文件 CFile file(sFile, CFile::modeCreate | CFile::modeWrite ); file.WriteHuge(sUserName.GetBuffer(sUserName.GetLength()),sUserName.GetLength()); file.WriteHuge("~",1); file.WriteHuge(sSerialNumber.GetBuffer(sSerialNumber.GetLength()),sSerialNumber.GetLength( )); file.Close(); MessageBox("注册文件生成完毕,其路径为: "+sFile, "系统提示",MBGsi_OK|MBGsi_ICONEXCLAMATION); } void CDRegedit::OnButreg() { 将用户名与机器码作异或运算 CString sName,sNameCode,sCode; this->mGsi_EdtUserName.GetWindowText(sName); char cNameCode=sName.GetBuffer(sName.GetLength()); DWORD dNameCode=cNameCode; sCode.Format("%d",mGsi_VolumnSerialNumber^dNameCode); for(int i=0;i<sCode.GetLength();i++) { if((i+1)%4==0) sCode.Insert(i,"-"); } CString sCodeText; CString sPath; this->mGsi_EdtCode.GetWindowText(sCodeText);

写入文件 if(sCodeText==sCode)注册成功 { char cPath[Gsi_MAXGsi_DIR]; ::GetSystemDirectory(cPath,sizeof(cPath)); sPath.Format("%s\\SYSRX.ini",cPath); ::WritePrivateProfileString("ENROL","NAME",sName,sPath); ::WritePrivateProfileString("ENROL","CODE",sCode,sPath); MessageBox("您已成功注册《系统》 ,感谢对软件事业的支持!", "系统提示",MBGsi_OK|MBGsi_ICONEXCLAMATION); pGsi_Try=true; this->OnCancel(); CDLogin dlg; dlg.DoModal(); } else MessageBox("您输入的用户名或注册码有误!请与供应商联系!", "系统提示",MBGsi_OK|MBGsi_ICONSTOP); } void CDRegedit::OnButtry() { HKEY Key; CString sKeyPath; sKeyPath="Software\\明日软件"; if(RegOpenKey(HKEYGsi_CURRENTGsi_USER,sKeyPath,&Key)!=0 &&RegOpenKey(HKEYGsi_CURRENTGsi_USER,sKeyPath,&Key)!=ERRORGsi_SUCCESS) { 在注册表中记录已试用的次数 ::RegCreateKey(HKEYGsi_CURRENTGsi_USER,sKeyPath,&Key); ::RegSetValueEx(Key,"TryTime",0,REGGsi_SZ,(unsigned char)"99",2); ::RegCloseKey(Key); MessageBox("您还可以试用 99 次! ","系统提示",MBGsi_OK|MBGsi_ICONEXCLAMATION); CDLogin dlg; dlg.DoModal(); return; } else 已经存在注册信息 { CString sTryTime; int nTryTime; LPBYTE Data=new BYTE[80]; DWORD TYPE=REGGsi_SZ; DWORD cbData=80; 取出已记载的数量

::RegQueryValueEx(Key,"TryTime",0,&TYPE,Data,&cbData); sTryTime.Format("%s",Data); nTryTime=atoi(sTryTime); if(nTryTime<1) { MessageBox("您的最大试用次数已过,只有注册后才允许继续使用!", "系统提示",MBGsi_OK|MBGsi_ICONSTOP); this->mGsi_ButTry.EnableWindow(false); return; } nTryTime--; sTryTime.Format("%d",nTryTime); ::RegSetValueEx(Key,"TryTime",0,REGGsi_SZ,(unsigned char)sTryTime.GetBuffer(sTryTime.GetLength()),2); ::RegCloseKey(Key); MessageBox("您还可以试用"+sTryTime+"次!", "系统提示",MBGsi_OK|MBGsi_ICONEXCLAMATION); delete []Data; this->OnCancel(); CDLogin dlg; dlg.DoModal(); } } void CDRegedit::OnButexit() { this->OnCancel(); } BOOL CDRegedit::OnInitDialog() { CDialog::OnInitDialog(); 取得机器码(C 盘序列号) LPCTSTR lpRootPathName="C:\\"; LPTSTR lpVolumeNameBuffer=new char[12]; DWORD nVolumnNameSize=12; DWORD MaximumComponentLength; DWORD FileSystemFlags; LPTSTR lpFileSystemNameBuffer=new char[10]; DWORD FileSystemNameLength=12; GetVolumeInformation(lpRootPathName,lpVolumeNameBuffer,nVolumnNameSize,&mGsi_Volu mnSerialNumber,&MaximumComponentLength,&FileSystemFlags,lpFileSystemNameBuffer,File SystemNameLength); delete(lpVolumeNameBuffer); delete(lpFileSystemNameBuffer);

return TRUE; }

return TRUE unless you set the focus to a control EXCEPTION: OCX Property Pages should return FALSE


赞助商链接

更多相关文章:
CRC算法详解与c源码
CRC算法详解与c源码 - 循环冗余码(CRC,cyclic redundancy code)校验技术是一种十分有效的数据传输错误检测技术,能检验一位错、双 位错、所有的奇数错、所有长度...
C源码_Gp
C源码_Gp - C++编程=>Source Part Five MyView.cpp : implementation file #include stdafx.h #include a1.h...
C源码_PA
C源码_PA - C++ Source Reading Comprehension Part 1 Machine generated IDispatch wrapper class(es) cr...
μCOS-II中OS_SEM.C源码中文注释版
μCOS-II中OS_SEM.C源码中文注释版_计算机软件及应用_IT/计算机_专业资料。xilentz 的网络文摘博客园 首页 新随笔 联系 订阅 管理随笔 - 204 文章 - 0 评论...
C源码(XI)
C源码(XI) - C++ Source Part One {{NO_MpD_MpEPENDENCIES}} Microsoft Developer Studio generated inclu...
100个C源代码
100个C源代码 - 【程序 1】 题目:有 1、2、3、4 个数字,能组成多少个互不相同且无 重复数字的三位数?都是多少? 1.程序分析:可填在百位、十位、个位的...
C源码分析(O501)
C源码分析(O501) - C 源码(Kit3907WW) class CDrawKCPD : public CDrawDlg { public: CListCtrl GetListCtrl()...
C源码(RSI)
C源码(RSI) - C++ Source Part One #if !defined(AFX_DBASEDLG_H__4354EF66_EFC4_4EB3_AA69_4038FCA02537_...
C源码_P6111
C源码_P6111 - C 源码_i_Part Two a1Dlg.h : header file #include myfunction.h #include ToolBar1.h #if !...
C源码分析(Kit2111)
C源码分析(Kit2111) - C 源码分析(Kit2111) //CG: This file was added by the Splash Screen component. #ifnde...
更多相关标签:

All rights reserved Powered by 甜梦文库 9512.net

copyright ©right 2010-2021。
甜梦文库内容来自网络,如有侵犯请联系客服。zhit325@126.com|网站地图