⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xxvcview.cpp

📁 是有关HTTP下载的一些程序,本人已经测试过可以使用,希望大家喜欢
💻 CPP
字号:
// xxvcView.cpp : implementation of the CXxvcView class
//

#include "stdafx.h"
#include "xxvc.h"

#include "xxvcDoc.h"
#include "xxvcView.h"
#include "afxsock.h"
#include <afxinet.h> 

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CXxvcView

IMPLEMENT_DYNCREATE(CXxvcView, CHtmlView)

BEGIN_MESSAGE_MAP(CXxvcView, CHtmlView)
	//{{AFX_MSG_MAP(CXxvcView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CXxvcView construction/destruction

CXxvcView::CXxvcView()
{
wz.SetSize(0,5);num=0;
}

CXxvcView::~CXxvcView()
{
}

BOOL CXxvcView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CHtmlView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CXxvcView drawing

void CXxvcView::OnDraw(CDC* pDC)
{
	CXxvcDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

void CXxvcView::OnInitialUpdate()
{
	CHtmlView::OnInitialUpdate();

	// TODO: This code navigates to a popular spot on the web.
	//  change the code to go where you'd like.
	//Navigate2(_T("http://www.microsoft.com/visualc/"),NULL,NULL);
	CString s,m_infor;
	// TODO: Add your control notification handler code here
	CInternetSession mySession(NULL,0);
	CHttpFile* myHttpFile=NULL;
	m_infor="连接到站点\r\n";
	
	CString myData;
	myHttpFile=(CHttpFile*)mySession.OpenURL("http://www.xxvc.com/");
	while(myHttpFile->ReadString(myData))
	{
		m_infor=m_infor+"\r\n";
		m_infor+=myData;
	}
s=myHttpFile->GetFileURL();MessageBox(s);
s=myHttpFile->GetObject();MessageBox(s);
s=myHttpFile->GetVerb();MessageBox(s);
	myHttpFile->Close();
	mySession.Close();
MessageBox(m_infor);	
}

/////////////////////////////////////////////////////////////////////////////
// CXxvcView printing


/////////////////////////////////////////////////////////////////////////////
// CXxvcView diagnostics

#ifdef _DEBUG
void CXxvcView::AssertValid() const
{
	CHtmlView::AssertValid();
}

void CXxvcView::Dump(CDumpContext& dc) const
{
	CHtmlView::Dump(dc);
}

CXxvcDoc* CXxvcView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CXxvcDoc)));
	return (CXxvcDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CXxvcView message handlers

⌨️ 快捷键说明

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