单是否支持"模块的初始化"?

编程入门 行业动态 更新时间:2024-10-25 20:24:42
本文介绍了单是否支持"模块的初始化"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

只是好奇,如果单有对模块的初始化的支持? blogs.msdn/b/junfeng /archive/2005/11/19/494914.aspx

Just curious if mono has support for "Module Initializers"? blogs.msdn/b/junfeng/archive/2005/11/19/494914.aspx

推荐答案

是的。

我不知道IL,但我在C#

I don't know IL, but I wrote this in C#

using System; public class Program { public static void Main(string[] args) { Console.WriteLine("Main"); } }

然后我用monodis产生IL文件,我说这code中的.module MAIN.EXE行之后。

I then used monodis to generate the il file and I added this code after the .module main.exe line.

.method assembly specialname rtspecialname static void .cctor() cil managed { .maxstack 8 IL_0000: ldstr "module method" IL_0005: call void class [mscorlib]System.Console::WriteLine(string) IL_000a: ret }

和当它运行时,我得到的输出的预期。

And when it runs I get the output expected.

module method Main

无论ILASM和运行支持。

Both ilasm and the runtime supports it.

更多推荐

单是否支持"模块的初始化"?

本文发布于:2023-11-06 17:27:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564325.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初始化   模块   QUOT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!