zoukankan      html  css  js  c++  java
  • net中一些所封装的类

    之类的类,太多了

    //=========加密=================
    public static string Encrypto(string Source) 
    {
    System.Security.Cryptography.HashAlgorithm HashCryptoService;
    HashCryptoService = new System.Security.Cryptography.SHA1Managed();
    byte[] bytIn = System.Text.UTF8Encoding.UTF8.GetBytes(Source);
    byte[] bytOut = HashCryptoService.ComputeHash(bytIn);
    return Convert.ToBase64String(bytOut);
    }

    //=========3大显示数据绑定=================
    public void BindBaseList(System.Web.UI.WebControls.BaseDataList bdl_object,DataSet ds, string tbName)
    {
    bdl_object.DataSource=ds.Tables[tbName];
    bdl_object.DataBind();
    }

    //=========DropDownList数据绑定=================
    public static void CreateDropDownList(DropDownList ddl_object, DataTable dt, string s_text,string s_value)
    {
    ddl_object.DataSource = dt;
    ddl_object.DataTextField = s_text;
    ddl_object.DataValueField = s_value;
    ddl_object.DataBind();
    }

    #region================js控制=================
      public void Js_Alert_Only(Page page,string Alertstr)
      {
       page.RegisterStartupScript("king","<script language=javascript>alert(\"系统提示:"+Alertstr+"!\");</script>");
      }
      public void Js_Alert(string Alertstr)
      {
       System.Web.HttpContext.Current.Response.Write("<script>alert(\"系统提示:"+Alertstr+"!\");</script>");
       System.Web.HttpContext.Current.Response.End();
      }
      public void Js_Alert_HistoryBack(string Alertstr,int BackNum)
      {
       System.Web.HttpContext.Current.Response.Write("<script>alert(\"系统提示:"+Alertstr+"!\");history.back("+BackNum+");</script>");
       System.Web.HttpContext.Current.Response.End();
      }
      public void Js_Alert_Href(string Alertstr,string BackUrl)
      {
       System.Web.HttpContext.Current.Response.Write("<script>alert(\"系统提示:"+Alertstr+"!\");window.location.href=\""+BackUrl+"\";</script>");
       System.Web.HttpContext.Current.Response.End();
      }

      public void Js_Alert_ReloadParent_Only()
      {
       System.Web.HttpContext.Current.Response.Write("<script>window.opener.location.reload();</script>");
       System.Web.HttpContext.Current.Response.End();
      }
      public void Js_Alert_ReloadParentAndClose()
      {
       System.Web.HttpContext.Current.Response.Write("<script>window.opener.location.reload();window.close();</script>");
       System.Web.HttpContext.Current.Response.End();
      }

  • 相关阅读:
    [linux]记录如何设置一个新的vps
    [python]使用virtualenvWrapper
    Vulkan Tutorial 07 Window surface
    Vulkan Tutorial 08 交换链
    Android实现小圆点显示未读功能
    【内附下载资料】第14次年度敏捷报告背后的趋势
    一文看懂人脸识别算法技术发展脉络
    实践案例丨基于ModelArts AI市场算法MobileNet_v2实现花卉分类
    美女面试官问我Python如何优雅的创建临时文件,我的回答....
    绝了,华为云服务器“The 3”出道,每款都很能打
  • 原文地址:https://www.cnblogs.com/kingeric/p/766717.html
Copyright © 2011-2022 走看看