CInternetFile Class

Allows access to files on remote systems that use Internet protocols.

class CInternetFile : public CStdioFile

Members

Protected Constructors

Name

Description

CInternetFile::CInternetFile

Constructs a CInternetFile object.

Public Methods

Name

Description

CInternetFile::Abort

Closes the file, ignoring all warnings and errors.

CInternetFile::Close

Closes a CInternetFile and frees its resources.

CInternetFile::Flush

Flushes the contents of the write buffer and makes sure the data in memory is written to the target machine.

CInternetFile::GetLength

Returns the size of the file.

CInternetFile::Read

Reads the number of specified bytes.

CInternetFile::ReadString

Reads a stream of characters.

CInternetFile::Seek

Repositions the pointer in an open file.

CInternetFile::SetReadBufferSize

Sets the size of the buffer where data will be read.

CInternetFile::SetWriteBufferSize

Sets the size of the buffer where data will be written.

CInternetFile::Write

Writes the number of specified bytes.

CInternetFile::WriteString

Writes a null-terminated string to a file.

Public Operators

Name

Description

CInternetFile::operator HINTERNET

A casting operator for an Internet handle.

Protected Data Members

Name

Description

CInternetFile::m_hFile

A handle to a file.

Remarks

Provides a base class for the CHttpFile and CGopherFile file classes. You never create a CInternetFile object directly. Instead, create an object of one of its derived classes by calling CGopherConnection::OpenFile or CHttpConnection::OpenRequest. You also can create a CInternetFile object by calling CFtpConnection::OpenFile.

The CInternetFile member functions Open, LockRange, UnlockRange, and Duplicate are not implemented for CInternetFile. If you call these functions on a CInternetFile object, you will get a CNotSupportedException.

To learn more about how CInternetFile works with the other MFC Internet classes, see the article Internet Programming with WinInet.

Inheritance Hierarchy

CObject

CFile

CStdioFile

CInternetFile

Requirements

Header: afxinet.h

See Also

Reference

CStdioFile Class

Hierarchy Chart

CInternetConnection Class