从IL Method Name字符串中获取MethodBase [英] Get MethodBase from IL Method Name string

查看:83
本文介绍了从IL Method Name字符串中获取MethodBase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


我正在用C#编写自己的编程语言,我希望使用此功能导入dotnet静态方法。


<我需要将类似`[mscorlib] System.Console.WriteLine(System.String)`的字符串转换为MethodBase对象。 (我看过`callvirt`命令之后的IL Disassemblers输出中的字符串代码)


什么是最简单的方法? (我知道System.Reflection方式,我正在寻找一种更简单的方法)

解决方案

嗨  Mohammad Amin Mollazadeh,


感谢您在此发帖。


如您所知,对于您的问题,  ; System.Reflection是我们可以做你想做的事情的方式。如果您需要最简单的方法,可能是第三方工具?


请参考下面有关反射工具的链接。


https://www.solutionsiq.com/resource/blog-post/reflection-tools-for-net/


最好的问候,


Wendy


注意:此响应包含对第三方万维网站点的引用。 Microsoft提供此信息是为了方便您。


Microsoft不控制这些网站,也没有测试在这些网站上找到的任何软件或信息;因此,Microsoft不能就其中发现的任何软件或信息的质量,安全性或适用性做出任何陈述。

使用互联网上的任何软件都存在固有的危险,微软提醒您在从Internet检索任何软件之前确保您完全了解风险。


Hi!

I'm writing my own programming language in C# and I want use this feature for importing dotnet static methods.

I need to convert a string like `[mscorlib]System.Console.WriteLine(System.String)` to a MethodBase object. (I've seen codes like that given string in IL Disassemblers output after `callvirt` commands)

What's the easiest way? (I know the System.Reflection way I'm searching for a easier way)

解决方案

Hi Mohammad Amin Mollazadeh,

Thank you for posting here.

For your question,as I know, System.Reflection is the way we could do what you want. If you need easiest way, maybe third party tools?

Please refer to the links below about the reflection tools.

https://www.solutionsiq.com/resource/blog-post/reflection-tools-for-net/

Best Regards,

Wendy

Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you.
Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


这篇关于从IL Method Name字符串中获取MethodBase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆