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



更多相关文章:
C代码编写规范
C代码编写规范_计算机软件及应用_IT/计算机_专业资料。C 编程规范 1 布局与风格总体目标:准确表现代码的逻辑结构;改善可读性;经的起修改。 1. 总体布局 采用纯块...
string-c源代码
string-c源代码_计算机软件及应用_IT/计算机_专业资料。string.h头文件的源码/* * linux/lib/string.c * * Copyright (C) 1991, 1992 Linus Torvalds */ /...
C源码(107)
C源码(107)_学科竞赛_初中教育_教育专区。C 源码 Part One #if !defined(AFX_GUDPAGE1_H__8675A73D_2544_49A1_9DA7_2ADC4CDB8D30__INCLU DED_) #...
100个C源代码
2.程序源代码: #include "stdio.h" main() { char a=176,b=219; printf("%c%c%c%c%c\n",b,a,a,a,b); printf("%c%c%c%c%c\n",a,b,a...
C源码K
{ LPDISPATCH pDispatch; InvokeHelper(0x65, DISPATCHFxGp_PROPERTYGET, VTFxGp_DISPATCH, (void)&pDispatch, NULL); return CColumns(pDispatch); } C 源码 ...
C源码范例_第一部分
C源码范例_第一部分_科学_初中教育_教育专区。C++ Source Part One #if !defined(AFX_YiDWORKLOAD_YiH_YiDEAA9D77_Yi68E8_Yi4991_Yi9F1A_YiAB915D 84361D...
C源码(Part I)
条形码"; } C 源码 => Part Two DInventory.cpp: implementation of the CDInventory class. #include "stdafx.h" #include "MyProject.h" #include "D...
C源码(10)
C源码(10)_学科竞赛_初中教育_教育专区。/*** 说明: 在供应...c_FvXpintime,"temp"); m_FvXppRs->raw_FvXpClose(); //记录入库主表信息 m_FvXppRs...
C源码(9)
C源码(9)_学科竞赛_初中教育_教育专区。else { f_FvXpprice = atof(c_FvXpprice); f_FvXpnum = atof(c_FvXpnum); f_FvXprebate = atof(c_FvXpre...
C源码阅读(1)
C源码阅读(1)_学科竞赛_初中教育_教育专区。C Source Reading Part One #if !defined(AFX_BASEGICOMBOBOX_H__9E306658_436E_43BE_B492_6C7FB4A428A8_ _...
更多相关标签:

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

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