• 计算ScriptResource.axd的d参数


    protected void Page_Load(object sender, EventArgs e)

    { var url= string.Format("ScriptResource.axd?d={0}", PageEncryptString("Q|~/web.config|#|xlsb"));

    //var info = F.Studio.Web.Utility.MachineKeyUtil.GenerateMachineKey();

     //Response.Write("D->" + info.Decryption +":" + info.DecryptionKey +"
    "); //Response.Write("V->" + info.Validation +":" + info.ValidationKey);

    }

    public static string PageDecryptString(string input) {

    Type type = typeof(System.Web.UI.Page);

     object o = Activator.CreateInstance(type);

    System.Reflection.MethodInfo mi = type.GetMethod("DecryptString", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static, null, new Type[] { typeof(string) }, null);

    object result = mi.Invoke(o, new object[] { input }); return result.ToString();

    }

     public static string PageEncryptString(string input)

     {

    Type type = typeof(System.Web.UI.Page);

    object o = Activator.CreateInstance(type); System.Reflection.MethodInfo mi = type.GetMethod("EncryptString", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static, null, new Type[] { typeof(string) }, null); object result = mi.Invoke(o, new object[] { input }); return result.ToString();

     }

  • 相关阅读:
    直接插入排序学习笔记
    选择排序学习笔记
    冒泡排序学习笔记
    阿里云ssl证书申请及域名绑定流程
    Nginx user_agent、if指令及全局变量
    rewrite和return笔记
    rewrite和return的简单需求
    Nginx Rewrite正则表达式案例
    linux下WordPress伪静态规则设置
    集群前后端分离(api接口)
  • 原文地址:https://www.cnblogs.com/wdfrog/p/1834631.html
Copyright © 2020-2023  润新知