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

📄 sysconfigdlg.cpp

📁 一个SGIP网关的程序源码.vc代码
💻 CPP
字号:
// SYSConfigDlg.cpp : implementation file
//

#include "stdafx.h"
#include "SGIPGateWay.h"
#include "SYSConfigDlg.h"
#include "SystemProfile.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CSystemProfile gProfile;
/////////////////////////////////////////////////////////////////////////////
// CSYSConfigDlg dialog


CSYSConfigDlg::CSYSConfigDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSYSConfigDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSYSConfigDlg)
	mstrPort = _T("");
	mstrProtocol = _T("");
	mstrCorpId = _T("");
	mstrCorpname = _T("");
	mstrgatenumber = _T("");
	mstrLoginName = _T("");
	mstrLoginPassowrd = _T("");
	mstrSpnum = _T("");
	mlngSpnumber = 0;
	mstrmsglistenport = _T("");
	mstrmsgport = _T("");
	mstrmsgip = _T("");
	mnFeeType = 0;
	mstrFeeValue = _T("");
	//}}AFX_DATA_INIT
}


void CSYSConfigDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSYSConfigDlg)
	DDX_Text(pDX, IDC_EDIT_CLIENTPORT, mstrPort);
	DDX_Text(pDX, IDC_EDIT_CLIENTPROTOCOL, mstrProtocol);
	DDX_Text(pDX, IDC_EDIT_CORPID, mstrCorpId);
	DDX_Text(pDX, IDC_EDIT_CORPNAME, mstrCorpname);
	DDX_Text(pDX, IDC_EDIT_GATENUMBER, mstrgatenumber);
	DDX_Text(pDX, IDC_EDIT_LOGINNAME, mstrLoginName);
	DDX_Text(pDX, IDC_EDIT_LOGINPASSWORD, mstrLoginPassowrd);
	DDX_Text(pDX, IDC_EDIT_SPJDNUM, mstrSpnum);
	DDX_Text(pDX, IDC_EDIT_SPNUMBER, mlngSpnumber);
	DDX_Text(pDX, IDC_EDIT_SMGPORT, mstrmsglistenport);
	DDX_Text(pDX, IDC_EDIT_WGPORT, mstrmsgport);
	DDX_Text(pDX, IDC_EDIT_SMGIP, mstrmsgip);
	DDX_Text(pDX, IDC_FEETYPEEDIT, mnFeeType);
	DDX_Text(pDX, IDC_FEEVALUEEDIT, mstrFeeValue);
	DDV_MaxChars(pDX, mstrFeeValue, 5);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CSYSConfigDlg message handlers

BOOL CSYSConfigDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
    gProfile.ReadProfile();
	mstrPort =gProfile.mstrPort;
	mstrProtocol = 	    gProfile.mstrProtocol;
	mstrCorpId =        gProfile.mstrCorpId;
	mstrCorpname =      gProfile.mstrCorpname;
	mstrgatenumber = 	gProfile.mstrgatenumber;
	mstrLoginName =     gProfile.mstrLoginName;
	mstrLoginPassowrd = gProfile.mstrLoginPassowrd;
	mstrSpnum =         gProfile.mstrSpnum;;
	mlngSpnumber =      gProfile.mlngSpnumber;
	mstrmsglistenport = gProfile.mstrmsglistenport;
	mstrmsgport =       gProfile.mstrmsgport;
	mstrmsgip =         gProfile.mstrmsgip;
	mnFeeType =			gProfile.mnFeeType;
	mstrFeeValue =		gProfile.mstrFeeValue;
	UpdateData(false);

	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


void CSYSConfigDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(true);
     gProfile.mstrPort=mstrPort;
	 gProfile.mstrProtocol=mstrProtocol;
	 gProfile.mstrCorpId=mstrCorpId;
	 gProfile.mstrCorpname=mstrCorpname;
	 gProfile.mstrgatenumber=mstrgatenumber;
	 gProfile.mstrLoginName=mstrLoginName;
	 gProfile.mstrLoginPassowrd=mstrLoginPassowrd;
	 gProfile.mstrSpnum=mstrSpnum;
	 gProfile.mlngSpnumber=mlngSpnumber;
	 gProfile.mstrmsglistenport=mstrmsglistenport;
	 gProfile.mstrmsgport=mstrmsgport;
     gProfile.mstrmsgip=mstrmsgip;
	 gProfile.mnFeeType = mnFeeType;
	 gProfile.mstrFeeValue = mstrFeeValue;
      gProfile.WriteProfile();

	  MessageBox("某些参数改变需要重新启动系统才能生效!");
	CDialog::OnOK();
}

⌨️ 快捷键说明

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