SetDlgInputSite.cpp
资源名称:FTP总集.rar [点击查看]
上传用户:tjfeida
上传日期:2013-03-10
资源大小:1917k
文件大小:4k
源码类别:
Ftp客户端
开发平台:
Visual C++
- // SetDlgInputSite.cpp : implementation file
- //
- /*********************************************
- **该文件是属于WolfFTP工程中的。如果有什么问题
- **请联系
- ** tablejiang@21cn.com
- **或者访问
- ** http://wolfftp.51.net
- **以得到最新的支持。
- *********************************************/
- #include "stdafx.h"
- #include "QuickFTP.h"
- #include "SetDlgInputSite.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CSetDlgInputSite dialog
- CSetDlgInputSite::CSetDlgInputSite(CWnd* pParent /*=NULL*/)
- : CDialog(CSetDlgInputSite::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CSetDlgInputSite)
- m_strHostAddress = _T("");
- m_strLocalPath = _T("");
- m_strRemotePath = _T("");
- m_strPass = _T("");
- m_strUser = _T("");
- m_strHostName = _T("");
- //}}AFX_DATA_INIT
- memset( &m_SiteInfo , 0 , sizeof( m_SiteInfo ) ) ;
- m_bConnectEnable = false ;
- }
- void CSetDlgInputSite::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CSetDlgInputSite)
- DDX_Control(pDX, IDOK, m_CbtnOk);
- DDX_Control(pDX, IDC_RADIO2, m_Radio2);
- DDX_Control(pDX, IDC_RADIO1, m_Radio1);
- DDX_Text(pDX, IDC_EDIT_HOST_ADDRESS, m_strHostAddress);
- DDV_MaxChars(pDX, m_strHostAddress, 50);
- DDX_Text(pDX, IDC_EDIT_INIT_LOCAL_PATH, m_strLocalPath);
- DDV_MaxChars(pDX, m_strLocalPath, 260);
- DDX_Text(pDX, IDC_EDIT_INIT_REMOTE_PATH, m_strRemotePath);
- DDV_MaxChars(pDX, m_strRemotePath, 260);
- DDX_Text(pDX, IDC_EDIT_PASSWORD, m_strPass);
- DDV_MaxChars(pDX, m_strPass, 50);
- DDX_Text(pDX, IDC_EDIT_USERID, m_strUser);
- DDV_MaxChars(pDX, m_strUser, 50);
- DDX_Text(pDX, IDC_EDIT_HOST_NAME, m_strHostName);
- DDV_MaxChars(pDX, m_strHostName, 50);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CSetDlgInputSite, CDialog)
- //{{AFX_MSG_MAP(CSetDlgInputSite)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CSetDlgInputSite message handlers
- void CSetDlgInputSite::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData( TRUE ) ;
- //memset( &m_SiteInfo , 0 , sizeof( SITEINFO ) ) ;
- int iCur = 0 ;
- iCur = m_Radio1.GetCheck( );
- if( iCur == 1 )
- {
- m_SiteInfo.logintype = 0 ;
- }
- else
- m_SiteInfo.logintype = 1 ;
- strcpy( m_SiteInfo.sitename , (LPCTSTR)m_strHostName ) ;
- strcpy( m_SiteInfo.host , (LPCTSTR)m_strHostAddress ) ;
- strcpy( m_SiteInfo.user , (LPCTSTR)m_strUser ) ;
- strcpy( m_SiteInfo.pass , (LPCTSTR)m_strPass ) ;
- strcpy( m_SiteInfo.remotepath , m_strRemotePath ) ;
- strcpy( m_SiteInfo.localpath , m_strLocalPath ) ;
- //iCur = m_ServerType.GetCurSel () ;
- /*
- if( iCur == -1 )
- iCur = 0 ;
- m_SiteInfo.hosttype = iCur ;
- */
- CDialog::OnOK();
- }
- void CSetDlgInputSite::OnCancel()
- {
- // TODO: Add extra cleanup here
- CDialog::OnCancel();
- }
- BOOL CSetDlgInputSite::OnInitDialog()
- {
- CDialog::OnInitDialog();
- m_Radio1.SetCheck( 1 ) ;
- m_strHostAddress = m_SiteInfo.host ;
- m_strHostName = m_SiteInfo.sitename ;
- m_strLocalPath = m_SiteInfo.localpath ;
- m_strRemotePath = m_SiteInfo.remotepath ;
- m_strUser = m_SiteInfo.user ;
- m_strPass = m_SiteInfo.pass ;
- if( m_SiteInfo.logintype == 0 )
- {
- OnRadio1( ) ;
- }
- else
- {
- OnRadio2( ) ;
- }
- if( m_bConnectEnable )
- m_CbtnOk.SetWindowText( _T("连接") ) ;
- else
- m_CbtnOk.SetWindowText( _T("确定") ) ;
- //m_ServerType.SetCurSel( m_SiteInfo.hosttype ) ;
- 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 CSetDlgInputSite::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- m_Radio1.SetCheck( 0 ) ;
- m_Radio2.SetCheck( 1 ) ;
- }
- void CSetDlgInputSite::OnRadio1()
- {
- // TODO: Add your control notification handler code here
- m_Radio2.SetCheck( 0 ) ;
- m_Radio1.SetCheck( 1 ) ;
- }
- void CSetDlgInputSite::SetConnectEnable(BOOL bEnable)
- {
- m_bConnectEnable = bEnable ;
- }