相关疑难解决方法(0)

找到一个有反射的私人领域?

鉴于这门课程

class Foo
{
    // Want to find _bar with reflection
    [SomeAttribute]
    private string _bar;

    public string BigBar
    {
        get { return this._bar; }
    }
}
Run Code Online (Sandbox Code Playgroud)

我想找到我将用属性标记的私有项_bar.那可能吗?

我已经用我寻找属性的属性做了这个,但从来没有私有成员字段.

获取私有字段需要设置哪些绑定标志?

.net c# reflection .net-attributes

219
推荐指数
8
解决办法
15万
查看次数

标签 统计

.net ×1

.net-attributes ×1

c# ×1

reflection ×1