HtmlDocument.ExecCommand(String, Boolean, Object) 方法

定义

对文档执行指定的命令。Executes the specified command against the document.

public:
 void ExecCommand(System::String ^ command, bool showUI, System::Object ^ value);
public void ExecCommand (string command, bool showUI, object value);
member this.ExecCommand : string * bool * obj -> unit
Public Sub ExecCommand (command As String, showUI As Boolean, value As Object)

参数

command
String

要执行的命令的名称。The name of the command to execute.

showUI
Boolean

是否向用户显示命令特定的对话框或消息框。Whether or not to show command-specific dialog boxes or message boxes to the user.

value
Object

要使用该命令分配的值。The value to assign using the command. 并非适用于所有命令。Not applicable for all commands.

注解

ExecCommand 公开一大数组的命令,这些命令没有公开的方法 HtmlDocumentExecCommand exposes a large array of commands for which there are no methods exposed on HtmlDocument. 使用 ExecCommand 可以插入新的 HTML 元素、选择文本并设置文本格式,以及清除任何缓存的身份验证凭据。Using ExecCommand you can insert new HTML elements, select and format text, and clear any cached authentication credentials. 有关完整的命令列表,请参阅 命令标识符For a full list of commands, see Command Identifiers.

备注

某些命令(如 copy)具有返回值。Certain commands, such as copy, have return values. 在的当前实现中 ExecCommand ,无法从调用中获取返回值。In the current implementation of ExecCommand, you cannot obtain a return value from your call. 若要检索返回值,请改用引用的对应非托管方法 DomDocumentTo retrieve return values, use the corresponding unmanaged method on a DomDocument reference instead.

适用于