gpt4 book ai didi

c# - 我如何在 C# 中获取调用方法

转载 作者:IT王子 更新时间:2023-10-29 04:32:13 30 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How can I find the method that called the current method?

我需要一种方法来知道 C# 中调用方法的名称。

例如:

private void doSomething()
{
// I need to know who is calling me? (method1 or method2).

// do something pursuant to who is calling you?
}

private void method1()
{
doSomething();
}

private void method2()
{
doSomething();
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com