StackFrame.GetFileColumnNumber 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取文件中包含所执行代码的列号。 该信息通常从可执行文件的调试符号中提取。
public:
int GetFileColumnNumber();
public:
virtual int GetFileColumnNumber();
public int GetFileColumnNumber ();
public virtual int GetFileColumnNumber ();
member this.GetFileColumnNumber : unit -> int
abstract member GetFileColumnNumber : unit -> int
override this.GetFileColumnNumber : unit -> int
Public Function GetFileColumnNumber () As Integer
Public Overridable Function GetFileColumnNumber () As Integer
返回
文件列号;如果无法确定文件列号,则为 0(零)。
示例
下面的示例演示 GetFileColumnNumber 方法的用法。 此代码示例是为 StackFrame 类提供的一个更大示例的一部分。
// Display the stack frame properties.
StackFrame^ sf = st->GetFrame( i );
Console::WriteLine( " File: {0}", sf->GetFileName() );
Console::WriteLine( " Line Number: {0}", sf->GetFileLineNumber().ToString() );
// Note that the column number defaults to zero
// when not initialized.
Console::WriteLine( " Column Number: {0}", sf->GetFileColumnNumber().ToString() );
Console::WriteLine( " Intermediate Language Offset: {0}", sf->GetILOffset().ToString() );
Console::WriteLine( " Native Offset: {0}", sf->GetNativeOffset().ToString() );
// Display the stack frame properties.
StackFrame sf = st.GetFrame(i);
Console.WriteLine(" File: {0}", sf.GetFileName());
Console.WriteLine(" Line Number: {0}",
sf.GetFileLineNumber());
// Note that the column number defaults to zero
// when not initialized.
Console.WriteLine(" Column Number: {0}",
sf.GetFileColumnNumber());
if (sf.GetILOffset() != StackFrame.OFFSET_UNKNOWN)
{
Console.WriteLine(" Intermediate Language Offset: {0}",
sf.GetILOffset());
}
if (sf.GetNativeOffset() != StackFrame.OFFSET_UNKNOWN)
{
Console.WriteLine(" Native Offset: {0}",
sf.GetNativeOffset());
}
' Display the stack frame properties.
Dim sf As StackFrame = st.GetFrame(i)
Console.WriteLine(" File: {0}", sf.GetFileName())
Console.WriteLine(" Line Number: {0}", _
sf.GetFileLineNumber())
' The column number defaults to zero when not initialized.
Console.WriteLine(" Column Number: {0}", _
sf.GetFileColumnNumber())
If sf.GetILOffset <> StackFrame.OFFSET_UNKNOWN
Console.WriteLine(" Intermediate Language Offset: {0}", _
sf.GetILOffset())
End If
If sf.GetNativeOffset <> StackFrame.OFFSET_UNKNOWN
Console.WriteLine(" Native Offset: {0}", _
sf.GetNativeOffset())
End If