socketdialog.cpp

来自「The application wizard has created this 」· C++ 代码 · 共 59 行

CPP
59
字号
// SocketDialog.cpp : implementation file
//

#include "stdafx.h"
#include "SoccerDoctor.h"
#include "SocketDialog.h"


// CSocketDialog dialog

IMPLEMENT_DYNAMIC(CSocketDialog, CDialog)
CSocketDialog::CSocketDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CSocketDialog::IDD, pParent)
{
}

CSocketDialog::~CSocketDialog()
{
	theApp.WriteProfileString("USTCWrightEagle","SoccerDoctorServerHost",_ServerHost);
	theApp.WriteProfileInt("USTCWrightEagle","SoccerDoctorServerPort",_ServerPort);
}

void CSocketDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_SERVERPORT, _ServerPort);
	DDX_Text(pDX, IDC_SEVERHOST, _ServerHost);
}


BEGIN_MESSAGE_MAP(CSocketDialog, CDialog)
END_MESSAGE_MAP()


// 获得服务器的地址

CString CSocketDialog::getServerHost(void)
{
	return _ServerHost;
}

// 获得服务器端口号
short CSocketDialog::getServerPort(void)
{
	return _ServerPort;
}

BOOL CSocketDialog::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	_ServerHost = theApp.GetProfileString("USTCWrightEagle","SoccerDoctorServerHost","localhost") ;
	_ServerPort = theApp.GetProfileInt("USTCWrightEagle","SoccerDoctorServerPort",6000) ;
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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