⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configwebserverdlg.cpp

📁 用数据库控制树型控件现实内容的例子
💻 CPP
字号:
// ConfigWebServerDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Kill.h"
#include "ConfigWebServerDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CConfigWebServerDlg dialog


CConfigWebServerDlg::CConfigWebServerDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CConfigWebServerDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConfigWebServerDlg)
	m_InstallPackAddress = _T("");
	m_UnInstallPackAddress = _T("");
	//}}AFX_DATA_INIT
}


void CConfigWebServerDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConfigWebServerDlg)
	DDX_Text(pDX, IDC_INSTALLPACKET_EDIT, m_InstallPackAddress);
	DDX_Text(pDX, IDC_UNINSTALL_PACKET_EDIT, m_UnInstallPackAddress);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CConfigWebServerDlg, CDialog)
	//{{AFX_MSG_MAP(CConfigWebServerDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CConfigWebServerDlg message handlers

BOOL CConfigWebServerDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	char appPath[256];

	// TODO: Add extra initialization here
	GetCurrentDirectory(256,appPath); //取得应用程序当前路径
	CString  FilePath;
	FilePath.Format("%s",appPath);
	FilePath+="\\killconfig.ini";
	
	CString strSection       = "URL_ADDRESS";
    CString strSectionKey    = "URL1";
	char inBuf[80];
	GetPrivateProfileString (strSection,strSectionKey, NULL, inBuf, 80, FilePath); 
	m_InstallPackAddress=inBuf;
	

	strSection       = "URL_ADDRESS";
	strSectionKey    = "URL2";
	GetPrivateProfileString (strSection,strSectionKey, NULL, inBuf, 80, FilePath); 
	m_UnInstallPackAddress=inBuf;

	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CConfigWebServerDlg::OnOK() 
{
	// TODO: Add extra validation here
	char appPath[256];
	UpdateData(TRUE);
	GetCurrentDirectory(256,appPath); //取得应用程序当前路径
	CString  FilePath;
	FilePath.Format("%s",appPath);
	FilePath+="\\killconfig.ini";
	
	CString strSection       = "URL_ADDRESS";
    CString strSectionKey    = "URL1";
//    CString strValue       = _T("");
//	GetDlgItemText(IDC_EDIT1,strValue);
	WritePrivateProfileString (strSection,strSectionKey,  
        m_InstallPackAddress, FilePath); 
	
	strSection       = "URL_ADDRESS";
	strSectionKey    = "URL2";
//    strValue       = _T("");
//	GetDlgItemText(IDC_EDIT2,strValue);
	WritePrivateProfileString (strSection,strSectionKey,  
        m_UnInstallPackAddress, FilePath); 
	
	CDialog::OnOK();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -