随笔分类 - Dot Net相关代码总结
控制弹出页面大小,显示标记,按ctrl+enter发送,插入dropdownlist
摘要:控制弹出页面大小:function openScript(url, width, height){ var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=no,scrollbars=no,menubar=no,status=yes' ); }显示标记:Server.Ht...
阅读全文
上传控件
摘要:前台:<formid="upload"method="post"encType="multipart/form-data"runat="server"><tableclass="border"id="uploadtable"height="99%"cellSpacing="0"cellPadding="0"width="98%"align="center"border="0"ru...
阅读全文
读写web.config
摘要:using System.Data;读web.config:string str_webconfig = Server.MapPath("Web.config");DataSet dsxml = new DataSet();dsxml.ReadXml(str_webconfig);newsname.Text = dsxml.Tables[1].Rows[0][1].ToString();newsu...
阅读全文
框架结构中的页面跳转
摘要:Response.Write("<script>top.window.location.href('index.aspx')</script>");
阅读全文
颜色交替与按钮提示
摘要:private void dgrp_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label g=...
阅读全文
delete复选框(用于datagrid)
摘要:javascript代码:function select_deselectAll(chkVal,idVal){ var frm = document.forms[0]; for (i=0; i<frm.length; i++) { if (idVal.indexOf ('CheckAll') != -1) { if(chkVal == true) { frm.elements[i].ch...
阅读全文
数据库操作
摘要:using System.Configuration;using System.Data.OleDb ;using System.Data .SqlClient ;using System.Data ;///<add key="msolepath" value="Provider=SQLOLEDB.1;DataSource=(local);Initial Catalog=XXX;uid=zm...
阅读全文
合法用户验证(用于每一子页面)
摘要:/// <summary>///验证/// </summary>/// ex:Validate(Session,this,1,2,pagename);///userid = DecryptCookie(Session["userid"].ToString(),1);///userpwd = DecryptCookie(Session["userpwd"].ToString(...
阅读全文
合法用户验证函数(用于登录页面)
摘要:/// /// 用户验证 /// ///ex:Session["userid"]=sjmain.US.smis.Functions.EncryptCookie(username.Value.Trim(),1); ///Session["userpwd"]=sjmain.US.smis.Functions.EncryptCookie(password.Value.Trim(),2); pub...
阅读全文
数据加密3(不可逆)
摘要:/// /// 加密字符串,使用不同加密方法 /// /// encrypting string /// format,0 is SHA1,1 is MD5 /// public static string Encrypt(string stringToEncrypt,int encryptMethod) { string str = ""; switch(encryp...
阅读全文
数据加密2(可逆)
摘要:/// /// 加密 Cookie字符串 /// /// 需要加密的cookie字符串 /// /// 加密过的cookie字符串 public static string EncryptCookie(string cookie,int type) { string str = En(cookie,type); StringBuilder sb = new String...
阅读全文
数据加密1(可逆)
摘要:/// /// 加密字符串 /// /// stringusing System.Web.Security; public static string Encrypt(string stringToEncrypt) { string str = ""; FormsAuthenticationTicket ticket = new System.Web.Security.For...
阅读全文
浙公网安备 33010602011771号