类似的工具反射器 http://www.reflector.net/让这变得相当简单。您甚至可以使用 .NET Framework 的一部分附带的 ILDASM。
您可以使用这两个工具之一加载主互操作程序集。 Reflector 将 C# 源代码显示为:
public enum WdCollapseDirection
{
wdCollapseEnd,
wdCollapseStart
}
由于它们没有明确的值,wdCollapseEnd
是 0 并且wdCollapseStart
是1。我们可以用IL视图来确认:
.class public auto ansi sealed WdCollapseDirection
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype Microsoft.Office.Interop.Word.WdCollapseDirection wdCollapseEnd = int32(0)
.field public static literal valuetype Microsoft.Office.Interop.Word.WdCollapseDirection wdCollapseStart = int32(1)
}
ILDASM http://msdn.microsoft.com/en-us/library/f7dy01k1(v=VS.100).aspx显示这个:
.field public static literal valuetype Microsoft.Office.Interop.Word.WdCollapseDirection wdCollapseEnd = int32(0x00000000)
If you have a tool like Resharper, doing Ctrl+Q on it directly from within Visual Studio shows this:
您可以有一个可用于查找值的虚拟项目。
作为附加选项,如果您使用LINQPad http://www.linqpad.net/您可以引用 Word Primary Interop Assembly(Microsoft.Office.Interop.Word - 应该在 GAC 中)并运行以下命令:
void Main()
{
var value = (int) Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseStart;
Console.Out.WriteLine("value = {0}", value);
}