【VC开源代码栏目提醒】:网学会员鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“FtpConnectDlg.cpp”一文,供大家参考学习
// FtpConnectDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FtpClient.h"
#include "FtpConnectDlg.h"
#include ".\ftpconnectdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFtpConnectDlg dialog
CFtpConnectDlg::CFtpConnectDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFtpConnectDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CFtpConnectDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CFtpConnectDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFtpConnectDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFtpConnectDlg, CDialog)
//{{AFX_MSG_MAP(CFtpConnectDlg)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFtpConnectDlg message handlers
LPCTSTR CFtpConnectDlg::GetUserName()
{
return (LPCTSTR)m_sUser;
}
LPCTSTR CFtpConnectDlg::GetPassword()
{
return (LPCTSTR)m_sPassword;
}
LPCTSTR CFtpConnectDlg::GetAddress()
{
return (LPCTSTR)m_sAddress;
}
UINT CFtpConnectDlg::GetPort() const
{
return m_nPort;
}
void CFtpConnectDlg::OnOK()
{
// TODO: Add extra validation here
m_nPort = GetDlgItemInt(IDC_EDIT_PORT,NULL,FALSE);
GetDlgItemText(IDC_EDIT_ADDRESS,m_sAddress);
GetDlgItemText(IDC_EDIT_USER,m_sUser);
GetDlgItemText(IDC_EDIT_PASSWORD,m_sPassword);
CDialog::OnOK();
}
BOOL CFtpConnectDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetDlgItemInt(IDC_EDIT_PORT,21,FALSE);
SetDlgItemText(IDC_EDIT_USER,"anonymous");
SetDlgItemText(IDC_EDIT_PASSWORD,"user@ad.org");
GetDlgItem(IDC_EDIT_ADDRESS)->SetFocus();
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFtpConnectDlg::OnBnClickedOk()
{
// TODO: 在此添加控件通知处理程序代码
OnOK();
}
上一篇:
FtpClientDlg.cpp
下一篇:
计算机网络毕业论文