zoukankan      html  css  js  c++  java
  • Reflector反编译结果的T?相对应的为Nullable(Of T)

        1、用Reflector反编译时,有时候会产生T?,这时候可用Nullable(Of T)代替,通过HasValue来判断是否有值,而Value能获取T的值。

        2、用Reflector反编译时,有时候会产生

        Try
            ...
        Catch X As Object
            ...
        End Try

        这时候应该用Exception代替Object,表示异常。

        3、用Reflector反编译时,有时候会产生

        Public Custom Event X As EventHandler
            AddHandler(ByVal value As EventHandler)
                Dim handler2 As EventHandler
                Dim x As EventHandler = Me.X
                Do
                    handler2 = x
                    Dim handler3 As EventHandler = DirectCast(Delegate.Combine(handler2, value), EventHandler)
                    x = Interlocked.CompareExchange(Of EventHandler)((Me.X), handler3, handler2)
                Loop While (Not x Is handler2)
            End AddHandler
            RemoveHandler(ByVal value As EventHandler)
                Dim handler2 As EventHandler
                Dim x As EventHandler = Me.X
                Do
                    handler2 = x
                    Dim handler3 As EventHandler = DirectCast(Delegate.Remove(handler2, value), EventHandler)
                    x = Interlocked.CompareExchange(Of EventHandler)((Me.X), handler3, handler2)
                Loop While (Not x Is handler2)
            End RemoveHandler
        End Event

         Private X As EventHandler

        这时候应该用去掉Custom,并删除AddHandler和RemoveHandler两个过程,以及声明。

        4、用Reflector反编译时,有时候会产生

        Public Property X As Integer
            Get
            Set (ByVal value As Integer)
        End Property

        <CompilerGenerated> _
        Private <X>k__BackingField As Integer

        这时候应该删除Get和Set语句,并删除编译产出的变量声明,或者补足Get和Set语句。

  • 相关阅读:
    周末郑州程序员朋友技术交流中的PPT
    WCF并发连接数的问题
    郑州.Net技术人员的招聘信息
    在路上
    Windows8体验(1)安装
    挖掘0day打进不同学校
    记一次绕过宝塔防火墙的BC站渗透
    一次实战中对tp5网站getshell方式的测试
    一次从弱口令到getshell
    一次HW实战
  • 原文地址:https://www.cnblogs.com/tulife/p/2217693.html
Copyright © 2011-2022 走看看