首页 新闻 会员 周边

如何调试静态构造函数中的代码

0
悬赏园豆:5 [已关闭问题]

遇到了一个问题:想看看静态构造函数中私有变量的初始化值,请大虾传授下调试的经验,代码如下:

 

Code
问题补充: 调用的代码为: _smtpClient.Host = EmailConfig.host;//指定SMTP服务器 _smtpClient.Port = EmailConfig.port; _smtpClient.Credentials = new System.Net.NetworkCredential(EmailConfig.username, EmailConfig.password);//用户名和密码 _smtpClient.EnableSsl = EmailConfig.enablessl;
Qubook的主页 Qubook | 初学一级 | 园豆:0
提问于:2009-01-19 16:12
< >
分享
其他回答(1)
0

是这个意思不?:

class A
{
    static private string s;
    static private int i;
    static private bool b;
    public static void B() { }
}


class test
{
    static void Main()
    {
        A.B();
        Console.Read();
    }
}

 

.load sos
已加载扩展 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll
!name2ee ph.exe A
PDB symbol for mscorwks.dll not loaded
Module: 00982c5c (ph.exe)
Token: 0x02000002
MethodTable: 009830b0
EEClass: 00981348
Name: A

!dumpclass   00981348
Class Name: A
mdToken: 02000002 (C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ph\ph\bin\Debug\ph.exe)
Parent Class: 790c3ef0
Module: 00982c5c
Method Table: 009830b0
Vtable Slots: 4
Total Method Slots: 5
Class Attributes: 100000  
NumInstanceFields: 0
NumStaticFields: 3
      MT    Field   Offset                 Type                 VT     Attr      Value      Name
793308ec  4000001        4        System.String     0   static   00000000      s
79332b38  4000002       1c         System.Int32    1   static         0               i
793043b8  4000003       20       System.Boolean  1   static        0              b

红泥 | 园豆:262 (菜鸟二级) | 2009-01-19 17:43
0

下断点调试,还能怎么样

Gray Zhang | 园豆:17610 (专家六级) | 2009-01-19 23:23
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册