随笔分类 - NET
摘要:ASP.NET 中在指定的位置处插入字符.这是论坛中的一个问题,很多人经常会遇到,就贴出来。
阅读全文
摘要:
我们在做用户登陆的时,很多时候我们的密码是区分大小写的,这就存在一个问题.如果你的Caps Lock键是亮着的,尽管你输入的密码是对的,也无法登陆.所以我们有必要在Caps Lock被按下的时候,提示用户.这就是这篇文章所要讲的. 你阅读过本文,你可以有一下几点收获 1:拥有一个免费的插件(可以提示Caps Lock) 2:你会对MicroSoft的验证控件有全新的认识(MicroSoft的验证控件的原理就是这样,当然比这复杂) 3:你将了解到在Assembly嵌入外部resource 3:你将了解到在Assembly嵌入外部resource
阅读全文
摘要: 最近看到很多人在问这个问题.就是如何在Mail的正文中如何显示附件的图片?本人也不会就去网上搜索.可是网上竟然没有(可能是太简单,很多人不屑提供代码),于是本人就尝试. 最先想到的就是outLook可以显示附件中的图片.于是在OutLook的邮件正文:右键-ViewSource 就看到了源代码" < img width=560 height=420 id="_x0000_i1025" src="cid:image001.jpg@01C8C4AF.C7E6ED20">" 这种代码 所以产生的第一个想法就是在写正文的时候,自动根据附件去生成类似代码.说干就干,马上动手!
阅读全文
摘要:Problem: Managing files web applications should be quick and easy and most importantly, consistent. The traditional way to store files is on the file system or within a RDBMS (SQL SERVER, Oracle, MySql) or on SharePoint. However what if you were developing several applications that shared a million files and each was 5MB. Which solution would you choose? This is commonly the case for large content driven sites (Music Stores, video sharing sites, content management systems, etc). Solutio
阅读全文
摘要:一、数据库操作 1、用完马上关闭数据库连接 访问数据库资源需要创建连接、打开连接和关闭连接几个操作。这些过程需要多次与数据库交换信息以通过身份验证,比较耗费服务器资 源。ASP.NET中提供了连接池(Connection Pool)改善打开和关闭数据库对性能的影响。系统将用户的数据库连接放在连接池中,需要时取出,关闭时收回连接,等待下一次的连接请求。 连接池的大小是有限的,如果在连接池达到最大限度后仍要求创建连接,必然大大影响性能。因此,在建立数据库连接后只有在真正需要操作时才打开连接,使用完毕后马上关闭,从而尽量减少数据库连接打开的时间,避免出现超出连接限制的情况。 用(推荐) using(SqlConnection Conn=new SqlConnection(connstr)) {}//不必显示关闭 或 try{conn.Open();} catch{} finally{conn.Close();} b
阅读全文
摘要:在发布创建自己的应用池的文章后,很好博友,希望能看到图文的教程,现在帖出来,大家共勉!
MSI 制作图文教程,如果需要源程序.可以留下Mail,我会发送到邮箱!
谢谢
阅读全文
摘要:MSI制作在打包的时候,创建应用程序池,并自动将程序assign到新创建的池中(MSI制作)
阅读全文
摘要:Post-Cache Substitution The post-cache substitution feature (which is new in ASP.NET 2.0) revolves around a single method that has been added to the HttpResponse class. The method is WriteSubstitution(), and it accepts a single parameter—a delegate that points to a callback method that you implement in your page class. This callback method returns the content for that portion of the page.
阅读全文
摘要:Formatting Fields Each BoundField column provides a DataFormatString property that you can use to configure the appearance of numbers and dates using a format string. Format strings are generally made up of a placeholder and format indicator, which are wrapped inside curly brackets. A typical format string looks something like this: {0:C}
阅读全文
摘要:Other Types of Expressions Data binding expressions are always wrapped in the characters. ASP.NET 2.0 also adds support for different types of expressions, commonly known as $ expressions because they incorporate the $ character. Technically, a $ expression is a code sequence that you can add to an .aspx page and that will be evaluated by an expression builder when the page is rendered. The expression builder processes the expression and replaces it with a string v
阅读全文
摘要:或许,在asp.net程序钟我们经常使用Transaction,但是我们很少去考虑它对我们程序Performance的影响.所以引起了很多问题,下面几点是我们应该在使用事务的时候应该注意的.
阅读全文
摘要:Configuring Session State You can configure session state through the element in the web.config file for your application. Here’s a snapshot of all the available settings you can use: sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10" sqlConnectionString="data source=127.0.0.1;Integrated Securi
阅读全文
摘要:Some times, we want to pass values from one page to another page. There are many ways by which we can do this like: by using query string, or session variable, or Server.Transer etc. Web Forms pages are classes in your application, and as such, you can create properties for them as you would any class. However, Web Forms pages have a very short lifetime, since they effectively exist only long enough to perform page processing. Properties on a Web Forms page therefore have limited use, s
阅读全文
摘要:ASP.NET State Management ASP.NET includes a variety of options for state management. It features the same Session and Application state collections as traditional ASP (with a few enhancements) and an entirely new view state model. ASP.NET even includes a caching system that allows you to retain information without sacrificing server scalability. Each state management choice has a different lifetime, scope, performance overhead, and level of support. 下表是Collection-based st
阅读全文
摘要:ASP.NET ASP.NET 应用程序生命周期概述 本主题概述应用程序生命周期,列出重要的生命周期事件,并描述如何编写适合应用程序生命周期的代码。在 ASP.NET 中,若要对 ASP.NET 应用程序进行初始化并使它处理请求,必须执行一些处理步骤。此外,ASP.NET 只是对浏览器发出的请求进行处理的 Web 服务器结构的一部分。了解应用程序生命周期非常重要,这样才能在适当的生命周期阶段编写代码,达到预期的效果。 应用程序生命周期概述 下表描述了 ASP.NET 应用程序生命周期的各个阶段。
阅读全文
摘要:页面经历了各个阶段:初始化、加载视图状态信息和回发数据、加载页面的用户代码以及执行回发服务器端事件。之后,页面进入显示模式:收集更新的视图状态,生成 HTML 代码并随后将代码发送到输出控制台。最后,卸载页面,并认为请求处理完毕。 在各个阶段中,页面会触发少数几个事件,这些事件可以由 Web 控件和用户定义的代码截取并进行处理。其中的一些事件是嵌入式控件专用的,因此无法在 .aspx 代码级进行处理。 要处理特定事件的页面应该明确注册一个适合的处理程序。不过,为了向后兼容早期的 Visual Basic 编程风格,ASP.NET 也支持隐式事件挂钩的形式。默认情况下,页面会尝试将特定的方法名称与事件相匹配,如果实现匹配,则认为此方法就是匹配事件的处理程序。ASP.NET 提供了六种方法名称的特定识别,它们是 Page_Init、Page_Load、Page_DataBind、Page_PreRender 和 Page_Unload。这些方法被认为是由 Page 类提供的相应事件的处理程序。HTTP 运行时会自动将这些方法绑定到页面事件,这样,开发人员
阅读全文
摘要:HttpHandler 创建图片验证码,
阅读全文
摘要:1:Application Updates One of the most remarkable features about the ASP.NET execution model is that you can update your web application without needing to restart the web server and without worrying about harming existing clients. This means you can add, replace, or delete files in the virtual directory at any time. ASP.NET then performs the same transition to a new application domain that it performs when you modify the web.config configuration file
阅读全文
摘要:1、Server.Transfer - 用于把处理的控制权从一个页面转移到另一个页面,在转移的过程中,没有离开服务器,内部控件(如:request, session 等)的保存的信息不变,因此,你能从页面 A 跳到页面 B 而不会丢失页面 A 中收集的用户提交信息。此外,在转移的过程中,浏览器的 URL 栏不变。 2、Response.Redirect - 发送一个 HTTP 响应到客户端,告诉客户端跳转到一个新的页面,客户端再发送跳转请求到服务器。使用此方法时,将无法保存所有的内部控件数据,页面 A 跳转到页面 B,页面 B 将无法访问页面 A 中 Form 提交的数据。
阅读全文
摘要:由于前段时间做大数据量的导入程序.在做的时候遇到的问题.几万条的数据从Excel中导入到数据库中,速度是非常的慢,程序简直不能运行,后来就研究了BCP命令的方式进行导入.几十万的数据也就几十秒,很快,所以将自己的小成果给大家分享.当然,可能有很多可以完善的地方,大家共同努力吧 使用BCP 命令输入大量的数据 1:目的:将大两数据输入sql server 等数据库 2:方法:BCP命令 3:实现方式: Sql 语句:
阅读全文