BOOL EnableCommand( |
|
LPCTSTR lpszCommand |
|
); |
Enable a specific server command.
Parameters
- lpszCommand
- A pointer to a NULL terminated string that specifies the name of
the command to be enabled or disabled. The command name is not
case-sensitive, but the value must otherwise match the exact name.
Partial matches are not recognized by this method. This parameter
cannot be NULL.
- bEnable
- An integer value which specifies if the command should be
enabled or disabled. If the value is non-zero, the command is
enabled. If the value is zero, the command will be disabled.
Return Value
If the method succeeds, the return value is non-zero. If the
client ID does not specify a valid client session,
the method will return zero. If the method fails, the
GetLastError method will return more information about the
last error that has occurred.
Remarks
The EnableCommand method is used to enable access to a
specific command on the server. The IsCommandEnabled method
can be used to determine if a command is enabled or not. The command
name provided to this method must match the commands defined in
RFC 2616 or related protocol standards. Refer to
Hypertext Transfer Protocol
Commands for a complete list of server commands.
The OPTIONS and TRACE commands are disabled by default for all
server instances and must be explicitly enabled using the
EnableCommand method if you wish permit clients to use them. It is
not recommended that you enable these commands if your server is going
to be publicly accessible over the Internet. If the server started
with the option HTTP_SERVER_READONLY, commands that can be used to
create or modify files on the server will be disabled by default.
Requirements
Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cshtsv11.lib
Unicode: Implemented as Unicode and ANSI versions
See Also
AuthenticateClient,
DisableCommand,
IsCommandEnabled
|