共用方式為


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
CGopher連線ion 物件的指標

hSession
目前網際網路會話的控制碼。

pstrLocator
用來尋找 Gopher 伺服器的字串指標。 如需 Gopher 定位器的詳細資訊,請參閱 Gopher 會話

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

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

備註

您需要物件 CGopherFile 才能在 Gopher 網際網路會話期間從檔案讀取。

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

另請參閱

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