我该如何计算code运行时校验?我该、code

由网友(是谁改写了结局*)分享简介:我有运行的计算机上的C#.NET应用程序。如何计算的整个code校验在运行时?I have a C#.NET application running on a machine. How do I calculate the checksum of the entire code at runtime?我不想计算图像...

我有运行的计算机上的C#.NET应用程序。如何计算的整个code校验在运行时?

I have a C#.NET application running on a machine. How do I calculate the checksum of the entire code at runtime?

我不想计算图像中使用,但实际的code部分的校验和。

I do not want to calculate the checksum of the image in use but the actual code part.

推荐答案

我从来没有使用过这一点,但是:

I have never used this, but:

使用反射,你可以浏览到 GetILAsByteArray ,做一个校验和(每个方法)。

Using reflection you can navigate to the GetILAsByteArray and do a checksum (per method).

不过,我认为这将是一个更容易使用code签字或Assembly.GetExecutingAssembly,然后做该.dll或.exe的校验和。

But I think it will be a lot easier to use code signing or the Assembly.GetExecutingAssembly and then do a checksum on the .dll or .exe.

阅读全文

相关推荐

最新文章