摘要:///<summary>///将指定字符串按指定长度进行剪切,///</summary>///<paramname="oldStr">需要截断的字符串</param>///<paramname="maxLength">字符串的最大长度</param>///<paramname="endWith">超过长度的后缀</param>///<returns>如果超过长度,返回截断后的新字符串加上后缀,否则,返回原字符串</retu
阅读全文
摘要:1 在web.config中添加配置信息 2 添加引用 引用程序集添加引用->选.Net下的->System.configuration 导入命名空间System.Configuration 3 获取连接字符串 public static string GetConStr() { //读取配置文件的字符串 ConnectionStringSetting setting = Confi...
阅读全文
摘要:1 添加一个验证码类,类里面写一个创建随机字符的方法 1 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->namespace Message.BLL { /// /// 验证码类 /// public clas...
阅读全文
摘要:1 在web.config的conafiguration里面添加 2 新建类库Data.cs里面的SqlConString静态私有属性读取配置文件 using System.Configuration; public class Data { private Data() { } ...
阅读全文
摘要:其实和GridView差不多的,如果模板中是有按钮之类的可以设置CommandName值的,可直接在ItemCommand事件中获取CommandName或者CommandArgument, 如果是模板中有文本框之类的,把文件框的AutoPostBack属性设置为True,然后在TextChanged事件中编写如下代码: //可以这样访问TextBox Code Code h...
阅读全文
摘要:示例代码: DataView data = (DataView) SqlDataSource1.Select(new DataSourceSelectArguments()); data.RowFilter = "Id=876"; gvtest.DataSource = data; gvtest.DataBind(); 使用前注意导入System.Data命名空...
阅读全文
摘要:GridView日期列使用DataFormatString="{0:d}",没有任何变化?依然显示“2006-3-30 0:00:00” 没有变化 应该加上 HtmlEncode="false" ,DataFormatString的设置才会生效。
阅读全文
摘要:Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "");
阅读全文
摘要:一、假设存储过程如下 --region [dbo].[InsertArchive] ------------------------------------------------------------------------------------------------------------------------ -- Generated By: wangzeng using ...
阅读全文
摘要:Web.Config中读取数据库连接字符串: string conn = System.Web.Configuration.WebConfigurationManager.ConnectionStrings ["conn"].ToString(); 加密数据库连接字符串: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe...
阅读全文