CGopherFile 類別

提供在 Gopher 伺服器上尋找和讀取檔案的功能。

注意

類別 CGopherConnectionCGopherFileCGopherFileFindCGopherLocator 和 其成員已被取代,因為它們無法在 Windows XP 平台上運作,但他們會繼續在舊版平台上運作。

語法

class CGopherFile : public CInternetFile

成員

受保護的建構函式

名稱 描述
CGopherFile::CGopherFile 建構 CGopherFile 物件。

備註

gopher 服務不允許使用者將數據寫入 Gopher 檔案,因為此服務主要是做為功能表驅動介面來尋找資訊。 成員 CGopherFile 函式 WriteWriteStringFlush 不會針對 實作 CGopherFile。 在物件上 CGopherFile 呼叫這些函式,會 傳回 CNotSupportedException

若要深入瞭解如何使用CGopherFile其他 MFC 因特網類別,請參閱使用 WinInet 進行因特網程式設計一文

繼承階層架構

CObject

CFile

CStdioFile

CInternetFile

CGopherFile

需求

標頭: afxinet.h

CGopherFile::CGopherFile

呼叫這個成員函式來建構 CGopherFile 物件。

CGopherFile(
    HINTERNET hFile,
    CGopherLocator& refLocator,
    CGopherConnection* pConnection);

CGopherFile(
    HINTERNET hFile,
    HINTERNET hSession,
    LPCTSTR pstrLocator,
    DWORD dwLocLen,
    DWORD_PTR dwContext);

參數

hFile
HINTERNET 檔案的句柄。

refLocator
CGopherLocator 對象的參考

pConnection
CGopherConnection 物件的指標

hSession
目前網際網路工作階段的控制代碼。

pstrLocator
用來尋找 gopher 伺服器的字串指標。 如需 Gopher 定位器的詳細資訊,請參閱 Gopher 工作階段

dwLocLen
包含 pstrLocator 中位元節數目的 DWORD。

dwContext
要開啟之檔案之內容標識碼的指標。

備註

您需要物件 CGopherFile 才能在 Gopher 因特網工作階段期間從檔案讀取。

您永遠不會直接建立 CGopherFile 物件。 請改為呼叫 CGopherConnection::OpenFile 以在 gopher 伺服器上開啟檔案。

另請參閱

CInternetFile 類別
階層架構圖表
CInternetFile 類別
CGopherLocator 類別
CGopherFileFind 類別
CGopherConnection 類別