www.pudn.com > FindMails.rar > Buy.cpp


// Buy.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "findemail.h" 
#include "Buy.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CBuy dialog 
extern CString Product_Id; 
 
 
CBuy::CBuy(CWnd* pParent /*=NULL*/) 
	: CDialog(CBuy::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CBuy) 
	//}}AFX_DATA_INIT 
} 
 
 
void CBuy::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CBuy) 
	DDX_Control(pDX, IDC_PRODUCT, m_Product); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CBuy, CDialog) 
	//{{AFX_MSG_MAP(CBuy) 
	ON_BN_CLICKED(IDC_BUTTON1, OnOK) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CBuy message handlers 
/* 
void CBuy::OnButtonsend()  
{ 
	// TODO: Add your control notification handler code here 
 
	CWaitCursor cursor; 
	UpdateData(true); 
	if(m_MailFrom=="") 
	{ 
		AfxMessageBox("Please input your EMail"); 
		return; 
	} 
	if(m_MailFrom.Find("@")==-1||m_MailFrom.Find(".")==-1) 
	{ 
		AfxMessageBox("lease input correct EMail"); 
		return; 
	} 
	if(m_Name=="") 
	{ 
		AfxMessageBox("Please input your name"); 
		return; 
	} 
	m_SendButton.EnableWindow(false); 
	CString MachineNum; 
	char hostname[80]; 
	gethostname(hostname,80); 
	MachineNum.Format("%s%d%d%d%d",hostname,_osver,_winmajor,_winminor 
		,_winver); 
	smtp.mfrom=m_MailFrom; 
	smtp.mbody=m_Name+"
MachineNumber:"+MachineNum; smtp.mserver="smtp.263.net"; smtp.msubject="purchase software!"; smtp.mto="garping@263.net"; if(!smtp.Connect()) { AfxMessageBox("Cant't connect ! "); return; } if(!smtp.transmit_message()) { AfxMessageBox("Fail to Send! Please use outlook software email to hallion@163.net"); } else { AfxMessageBox("Thank you!"); } smtp.Disconnect(); m_SendButton.EnableWindow(true); } */ BOOL CBuy::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here /* CString MachineNum; char hostname[80]; gethostname(hostname,80); MachineNum.Format("%s%d%d%d%d",hostname,_osver,_winmajor,_winminor ,_winver); */ m_Product.SetWindowText(Product_Id); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CBuy::OnOK() { // TODO: Add your control notification handler code here CDialog::OnOK(); }