|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册
x
本帖最后由 DDD888 于 23-8-2013 20:55 编辑
Good evening,
I need to write c# using Mono.cecil for new DateTime(2012, 1, 18)
Here is the il code.
IL_0000: ldc.i4 2012
IL_0005: ldc.i4.1
IL_0006: ldc.i4.s 18
IL_0008: newobj instance void [mscorlib]System.DateTime::.ctor(int32, int32, int32)
IL_000d: ret
Here is my partial c# code.
var body = new MethodBody(method);
var ins = body.Instructions;
ins.Add(Instruction.Create(OpCodes.Ldc_I4, 2012));
ins.Add(Instruction.Create(OpCodes.Ldc_I4_1));
ins.Add(Instruction.Create(OpCodes.Ldc_I4_S, 18));
I don't know how to write new obj instance statement.
ins.Add(Instruction.Create(OpCodes.Newobj,));
Do you know how to do that?
TIA
|
|