HtmlDocument.Title Propiedad

Definición

Obtiene o establece el valor de texto de la <etiqueta TITLE> en el documento HTML actual.

public:
 property System::String ^ Title { System::String ^ get(); void set(System::String ^ value); };
public string Title { get; set; }
member this.Title : string with get, set
Public Property Title As String

Valor de propiedad

String

Título del documento actual.

Ejemplos

En el ejemplo de código siguiente se crea un hipervínculo HTML al documento actual mediante la dirección URL del documento como la ubicación del vínculo y el título del documento como texto del vínculo. El ejemplo de código requiere que la aplicación tenga un WebBrowser control denominado WebBrowser1.

private void ExportDocumentLink()
{
    if (webBrowser1.Document != null)
    {
        HtmlDocument doc = webBrowser1.Document;
        String link = "<A HREF=\"" + webBrowser1.Document.Url.ToString() + "\">" + webBrowser1.Document.Title + "</A>";

        IDataObject dataObj = Clipboard.GetDataObject();
        dataObj.SetData("HTML", true, (object)link);
    }
}
Private Sub ExportDocumentLink()
    If (WebBrowser1.Document IsNot Nothing) Then
        Dim Link As String = "<A HREF=""" & WebBrowser1.Document.Url.ToString() & """>" & WebBrowser1.Document.Title & "</A>"

        Dim DataObj As IDataObject = Clipboard.GetDataObject()
        DataObj.SetData("Html", True, CObj(Link))
    End If
End Sub

Comentarios

Utilice la Title propiedad para identificar el documento mediante un nombre legible.

Los cambios realizados en esta propiedad también se reflejarán en la DocumentTitle propiedad del WebBrowser control .

Se aplica a

Consulte también