
ASP.net 经典问题
envykok
这个作者很懒,什么都没留下…
展开
-
Don’t run production ASP.NET Applications with debug=”true” enabled
Author : Scott Guthrie (manager of the ASP.NET development team)http://weblogs.asp.net/scottgu/archive/2006/04/11/442448.aspxOneof the things you want to avoid when deploying an ASP.NET applicationinto production is to accidentally (or deliberately) le转载 2010-07-01 14:33:00 · 217 阅读 · 0 评论 -
C#中使用Monitor类、Lock和Mutex类来同步多线程的执行
http://blog.youkuaiyun.com/tjvictor/archive/2007/01/20/1488290.aspxC#中使用Monitor类、Lock和Mutex类来同步多线程的执行 在多线程中,为了使数据保持一致性必须要对数据或是访问数据的函数加锁,在数据库中这是很常见的,但是在程序中由于大部分都是单线程的程序,所以没有加锁的必要,但是在多线程中,为了保持数据的同步,一定要加锁,好在Framework中已经为我们提供了三个加锁的机制,分别是Monitor类、Lock关键字和Mutex转载 2010-08-24 23:32:00 · 246 阅读 · 0 评论 -
Use Delegate to implement asynchronous call
<br />http://support.microsoft.com/kb/315582/zh-tw<br /> <br />(1) 呼叫同步方法<br /> s = dlgt(3000, out iExecThread); <br /><br /> <br />using System;using System.Threading ; using System.Windows.Forms ;public class AsyncDemo{ string LongRunningMetho转载 2010-09-07 22:32:00 · 187 阅读 · 0 评论 -
Best way to handle handle database schema change for generated dataset
<br />refer to : http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/339fbbc6-4f28-4f99-83fc-bdc647f56310<br /> <br /> <br />Problem Discription : When we update the database table schema, the *.xsd file is not being update at the s原创 2010-09-20 12:00:00 · 158 阅读 · 0 评论 -
扩展request & response Http Header
在Response 的 Http Header 中加入值:Response.AppendHeader("MYKEY", "myValue");读取Response Http Header 的信息 (from C# code ) HttpWebRequest loHttp = (HttpWebRequest)WebRequest.Create("http://localhost:53071/Default.aspx"); loHttp.Headers.Add("Name", "Du原创 2010-09-26 22:53:00 · 331 阅读 · 0 评论 -
Handling Your SQLException By Number
<br />If we are going to tell more specific sql error infromation from SQLException, we should use 'NUMBER' property of SQLException.switch (sqlexception.Number) { case (2): case(53): _error = DataAccessE原创 2010-12-28 15:12:00 · 281 阅读 · 0 评论 -
Asp.Net 防止重复提交方案
<br />http://www.cnblogs.com/fan2k/archive/2008/03/10/1098240.html<br />解决方法一:<br /><br /> .Framework2.0中才有的button属性:<asp:button id="Button2" onclick="btnSubmit_Click" runat="server" OnClientClick="this.disabled=true;this.form.submit();转载 2010-06-20 21:41:00 · 195 阅读 · 0 评论 -
(c#)数据结构与算法分析 --递归
(c#)数据结构与算法分析 --递归 http://www.cnblogs.com/PocketZ/archive/2010/04/14/1711989.html递归 不知道有新手听没听过别人拿剥糖块来形容递归,诸如一层层地剥好比一层层地进入递归。这种比喻可是误导了我,只想着剥了,其实剥完皮儿,取出糖块,再把皮儿一层层地穿上才算个完整的递归。 递归就是自己调用自己的函数或方法了,一般情况,像我这样的新手刚接触递归的时候,迷就迷在了不明白递归的原理上,在 (c#)数据结构与算法分析转载 2010-06-15 01:18:00 · 199 阅读 · 0 评论 -
用C# 画饼图,并在图上加注释
用C# 画饼图,并在图上加注释效果图 :代码:using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Syste原创 2010-07-04 23:05:00 · 718 阅读 · 1 评论 -
在C#中读写XML文件
http://blog.youkuaiyun.com/jingrenhai/archive/2007/09/27/1803055.aspx读: //打开某文件(假设web.config在根目录中)string filename=Server.MapPath("/") + @"WebApplication1/web.config";XmlDocument xmldoc= new XmlDocument();xmldoc.Load(filename);//得到顶层节点列表XmlNodeList topM转载 2010-07-08 14:53:00 · 162 阅读 · 0 评论 -
Function Overloading in Web Services
Function Overloading in Web Services<br />http://www.codeproject.com/KB/webservices/OverloadingInWebService.aspxBy dheerajindian |9 Oct 2008 How to perform function overloading in Web ServicesIs your email address OK? You are signed up for o转载 2010-07-13 11:41:00 · 180 阅读 · 0 评论 -
C# 中使用xslt & xml
using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebCont原创 2010-07-22 01:11:00 · 188 阅读 · 0 评论 -
XML 序列化[XmlElement] [XmlAttribute]理解
http://blog2.impx.net/dragonimp/archive/2005/03/26/735.html一般情况下,一个类只要加上Serializable特性进行声明就可以作为这样的配置类了:[Serializable]public class BlogConfigurationSettings 但仍然要注意几点:interface和abstract class不能作为配置类;类必须要有不带参数的公共构造函数;要作为配置参数的字段或者属性必须是public的,而转载 2010-06-09 23:32:00 · 1269 阅读 · 0 评论 -
XML Append Note happen "The node to be inserted is from a different document context."
Example :XmlDocument doc = new XmlDocument ();XmlNode rootNode = doc.CreateNode (XmlNodeType.Element, "usersettings",null);User user = new User (userid);XmlNode rolesNode = user.GetRoles ();rootNode.AppendChild (rolesNode);note: from envykokroo原创 2010-06-11 15:51:00 · 351 阅读 · 0 评论 -
How can you use optional parameters in C#?
http://stackoverflow.com/questions/199761/how-can-you-use-optional-parameters-in-cSolution 1 :In C#, I would normally use multiple forms of the method:voidGetFooBar(int a){int defaultBValue; GetFooBar(a, defaultBValue);}voidGetFooBar(int a,int b){ // wh转载 2010-06-13 21:37:00 · 164 阅读 · 0 评论 -
Client use XMLHTTP to call Web service via SOAP
http://www.codeproject.com/KB/webservices/aspwebsvr.aspxWeb Serviceusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Services;using System.Xml;using System.Xml.Serialization;using System.Xml.Lin原创 2010-06-14 16:28:00 · 195 阅读 · 0 评论 -
Response.Redirect,Server.Transfer,Server.Execute的区别(转)
Response.Redirect,Server.Transfer,Server.Execute的区别http://bikerocking.spaces.live.com/blog/cns!C44CCBA0044FD131!359.entry摘录在ASP.NET应用中,Web表单之间的导航有多种方式:用超级链接,用Response.Redirect,用Server.Transfer,或者用Server.Execute。本文将分析这四种导航方式的异同及其优缺点,帮助你选择最佳的导航方式。一、超级链接转载 2010-06-15 00:55:00 · 456 阅读 · 0 评论