Help2.GetNextTopic 方法

给定 URL 返回该目录下的 URL。

命名空间:  Microsoft.VisualStudio.VSHelp80
程序集:  Microsoft.VisualStudio.VSHelp80(在 Microsoft.VisualStudio.VSHelp80.dll 中)

语法

声明
Function GetNextTopic ( _
    bstrURL As String _
) As String
string GetNextTopic(
    string bstrURL
)
String^ GetNextTopic(
    [InAttribute] String^ bstrURL
)
abstract GetNextTopic : 
        bstrURL:string -> string
function GetNextTopic(
    bstrURL : String
) : String

参数

  • bstrURL
    类型:String

    字符串包含与 Internet Explorer 兼容当前主题的 URL。

返回值

类型:String
返回包含下主题的 URL 的字符串在目录中。

示例

创建 Visual Studio 外接程序使用 Visual C# 如 如何:创建外接程序所述。 添加对 Microsoft.VisualStudio.VSHelpMicrosoft.VisualStudio.VSHelp80System.Windows.Forms。 用下面的代码替换该 OnConnection 方法的代码在 Connect.cs 文件。 运行代码示例 如何:编译和运行自动化对象模型代码示例如中所述。

using System;
using Extensibility;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.VSHelp;
using Microsoft.VisualStudio.VSHelp80;
using System.Windows.Forms;

public void OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    HelpGetNextURLExample(_applicationObject);
}

public void HelpGetNextURLExample(DTE2 dte)
{
    // Returns and displays the URL of the topic that followins
    // the topic specified
    // by the URL in the table of contents.
    try
    {
        Microsoft.VisualStudio.VSHelp80.Help2 help2 =
(Microsoft.VisualStudio.VSHelp80.Help2)_applicationObject.GetObject 
("Help2");

        // Get the next URL from the Visual Studio topic
        // and display it.
        MessageBox.Show("The next URL after the supplied one is " 
+ "\n" + help2.GetNextTopic
("ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/
dv_vstoc/html/06ddebea-2c83-4a45-bb48-6264c797ed93.htm"));

    }
    catch (SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}

.NET Framework 安全性

请参阅

参考

Help2 接口

Microsoft.VisualStudio.VSHelp80 命名空间