Prerequisites for Internet Client Classes (WININET)

Prerequisites for Internet Client Classes 

 

Some actions taken by an Internet client (reading a file, for example) have prerequisite actions (in this case, establishing an Internet connection). The following tables list the prerequisites for some client actions.

General Internet URL (FTP, Gopher, or HTTP)
Action Prerequisite

Establish a connection.

Create a CInternetSession to establish the basis of an Internet client application.

Open a URL.

Establish a connection. Call CInternetSession::OpenURL. The OpenURL function returns a read-only resource object.

Read URL data.

Open the URL. Call CInternetFile::Read.

Query the setting of an Internet option.

Establish a connection. Call CInternetSession::QueryOption.

Set an Internet option.

Establish a connection. Call CInternetSession::SetOption.

Set a function to be called with status information.

Establish a connection. Call CInternetSession::EnableStatusCallback. Override CInternetSession::OnStatusCallback to handle calls.

FTP
Action Prerequisite

Establish an FTP connection.

Create a CInternetSession as the basis of this Internet client application. Call CInternetSession::GetFtpConnection to create a CFtpConnection object.

Find the first resource.

Establish an FTP connection. Create a CFtpFileFind object. Call CFtpFileFind::FindFile.

Enumerate all available resources.

Find the first file. Call CFtpFileFind::FindNextFile until it returns FALSE.

Open an FTP file.

Establish an FTP connection. Call CFtpConnection::OpenFile to create and open a CInternetFile object.

Read an FTP file.

Open an FTP file with read access. Call CInternetFile::Read.

Write to an FTP file.

Open an FTP file with write access. Call CInternetFile::Write.

Change the client's directory on the server.

Establish an FTP connection. Call CFtpConnection::SetCurrentDirectory.

Retrieve the client's current directory on the server.

Establish an FTP connection. Call CFtpConnection::GetCurrentDirectory.

HTTP
Action Prerequisite

Establish an HTTP connection.

Create a CInternetSession as the basis of this Internet client application. Call CInternetSession::GetHttpConnection to create a CHttpConnection object.

Open an HTTP file.

Establish an HTTP connection. Call CHttpConnection::OpenRequest to create a CHttpFile object. Call CHttpFile::AddRequestHeaders. Call CHttpFile::SendRequest.

Read an HTTP file.

Open an HTTP file. Call CInternetFile::Read.

Get information about an HTTP request.

Establish an HTTP connection. Call CHttpConnection::OpenRequest to create a CHttpFile object. Call CHttpFile::QueryInfo.

Gopher
Action Prerequisite

Establish a gopher connection.

Create a CInternetSession as the basis of this Internet client application. Call CInternetSession::GetGopherConnection to create a CGopherConnection.

Find the first file in the current directory.

Establish a gopher connection. Create a CGopherFileFind object. Call CGopherConnection::CreateLocator to create a CGopherLocator object. Pass the locator to CGopherFileFind::FindFile. Call CGopherFileFind::GetLocator to get the locator of a file if you need it later.

Enumerate all available files.

Find the first file. Call CGopherFileFind::FindNextFile until it returns FALSE.

Open a gopher file.

Establish a gopher connection. Create a gopher locator with CGopherConnection::CreateLocator or find a locator with CGopherFileFind::GetLocator. Call CGopherConnection::OpenFile.

Read a gopher file.

Open a gopher file. Use CGopherFile.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值