IVsTextLayer.GetLineText 方法

将文本指定的范围为 BSTR。

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

语法

声明
Function GetLineText ( _
    iStartLine As Integer, _
    iStartIndex As Integer, _
    iEndLine As Integer, _
    iEndIndex As Integer, _
    <OutAttribute> ByRef pbstrBuf As String _
) As Integer
int GetLineText(
    int iStartLine,
    int iStartIndex,
    int iEndLine,
    int iEndIndex,
    out string pbstrBuf
)
int GetLineText(
    [InAttribute] int iStartLine, 
    [InAttribute] int iStartIndex, 
    [InAttribute] int iEndLine, 
    [InAttribute] int iEndIndex, 
    [OutAttribute] String^% pbstrBuf
)
abstract GetLineText : 
        iStartLine:int * 
        iStartIndex:int * 
        iEndLine:int * 
        iEndIndex:int * 
        pbstrBuf:string byref -> int
function GetLineText(
    iStartLine : int, 
    iStartIndex : int, 
    iEndLine : int, 
    iEndIndex : int, 
    pbstrBuf : String
) : int

参数

  • iStartLine
    类型:Int32

    [in] 启动行。

  • iStartIndex
    类型:Int32

    [in] 在行内开始字符索引 (必须是行的 AMP_LT= 长度)。

  • iEndLine
    类型:Int32

    [in] 结束行。

  • iEndIndex
    类型:Int32

    [in] 在行内结束字符索引 (必须是行的 AMP_LT= 长度)。

  • pbstrBuf
    类型:String%

    [out] 范围中的文本。

返回值

类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 textmgr.idl:

HRESULT IVsTextLayer::GetLineText(
   [in] long iStartLine,
   [in] CharIndex iStartIndex,
   [in] long iEndLine,
   [in] CharIndex iEndIndex,
   [out] BSTR * pbstrBuf
);

.NET Framework 安全性

请参阅

参考

IVsTextLayer 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间