Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
POP.CPP
Package: NoPassword.rar [view]
Upload User: chenhai826
Upload Date: 2007-04-11
Package Size: 72k
Code Size: 1k
Category:
Crack_Hack
Development Platform:
Visual C++
- // Pop.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "Pop.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //////////////////////////////////////////////////////////////////////
- // CPop Class
- //////////////////////////////////////////////////////////////////////
- CPop::CPop()
- {
- m_PopServer.Create();
- }
- CPop::~CPop()
- {
- m_PopServer.Close();
- }
- int CPop::Connect(CString & Host, CString & User, int Password)
- {
- CString str;
- int err;
- if (!m_PopServer.Connect(Host))
- return REPORT_CONNECT_ERROR;
- if((err = CheckResponse())!=1)
- return (err==0)?REPORT_CONNECT_ERROR:REPORT_BAD_OTHER;
- str.Format("USER %srn",User);
- m_PopServer.Send(str.GetBuffer(100),str.GetLength());
- if((err=CheckResponse())!=1)
- return (err==0)?REPORT_BAD_USER:REPORT_BAD_OTHER;
- str.Format("PASS %drn",Password);
- m_PopServer.Send(str.GetBuffer(100),str.GetLength());
- if ((err=CheckResponse())!=1)
- return (err==0)?REPORT_BAD_PASSWORD:REPORT_BAD_OTHER;
- return REPORT_SUCCEED;
- }
- int CPop::CheckResponse()
- {
- char buf [512];
- int i = m_PopServer.Receive(buf, sizeof(buf));
- if(i == SOCKET_ERROR)
- return REPORT_BAD_OTHER;
- return buf[0] != '-';
- }
- void CPop::Disconnect(void)
- {
- m_PopServer.Send("QUIT rn", strlen("QUIT rn"));
- }