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大顯示數(shù)據(jù)綁定=================
public void BindBaseList(System.Web.UI.WebControls.BaseDataList bdl_object,DataSet ds, string tbName)
{
bdl_object.DataSource=ds.Tables[tbName];
bdl_object.DataBind();
}
//=========DropDownList數(shù)據(jù)綁定=================
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(\"系統(tǒng)提示:"+Alertstr+"!\");</script>");
??}
??public void Js_Alert(string Alertstr)
??{
???System.Web.HttpContext.Current.Response.Write("<script>alert(\"系統(tǒng)提示:"+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(\"系統(tǒng)提示:"+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(\"系統(tǒng)提示:"+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();
??}
轉(zhuǎn)載于:https://www.cnblogs.com/kingeric/archive/2007/05/31/766717.html
總結(jié)
以上是生活随笔為你收集整理的net中一些所封装的类的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 技术创业需胆识 谈IT技术人员的创业 (
- 下一篇: dell的1501和640m,买哪个好呢