HtmlDocument.Title Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the text value of the <TITLE>
tag in the current HTML document.
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
Property Value
The title of the current document.
Examples
The following code example creates an HTML hyperlink to the current document using the URL of the document as the link's location and the title of the document as the link text. The code example requires that your application has a WebBrowser control named 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
Remarks
Use the Title property to identify the document by way of a human-readable name.
Changes to this property will also reflect in the DocumentTitle property of the WebBrowser control.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기