CGopherConnection::CGopherConnection
This member function is called to construct a CGopherConnection object.
CGopherConnection(
CInternetSession* pSession,
HINTERNET hConnected,
LPCTSTR pstrServer,
DWORD_PTR dwContext
);
CGopherConnection(
CInternetSession* pSession,
LPCTSTR pstrServer,
LPCTSTR pstrUserName = NULL,
LPCTSTR pstrPassword = NULL,
DWORD_PTR dwContext = 0,
INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER
);
Параметры
pSession
A pointer to the related CInternetSession object.hConnected
The Windows handle of the current Internet session.pstrServer
A pointer to a string containing the FTP server name.dwContext
The context identifier for the operation. dwContext identifies the operation's status information returned by CInternetSession::OnStatusCallback. The default is set to 1; however, you can explicitly assign a specific context ID for the operation. The object and any work it does will be associated with that context ID.pstrUserName
Pointer to a null-terminated string that specifies the name of the user to log in. If NULL, the default is anonymous.pstrPassword
A pointer to a null-terminated string that specifies the password to use to log in. If both pstrPassword and pstrUserName are NULL, the default anonymous password is the user's email name. If pstrPassword is NULL (or an empty string) but pstrUserName is not NULL, a blank password is used. The following table describes the behavior for the four possible settings of pstrUserName and pstrPassword:pstrUserName
pstrPassword
Username sent to FTP server
Password sent to FTP server
NULL or " "
NULL or " "
"anonymous"
User's email name
Non-NULL String
NULL or " "
pstrUserName
" "
NULL Non-NULL String
ERROR
ERROR
Non-NULL String
Non-NULL String
pstrUserName
pstrPassword
nPort
A number that identifies the TCP/IP port to use on the server.
Заметки
You never create a CGopherConnection directly. Rather, call CInternetSession::GetGopherConnection, which creates a CGopherConnection object and returns a pointer to it.
Требования
Header: afxinet.h