随笔分类 -  .Net/C#

摘要:原文:http://www.sosuo8.com/article/show.asp?id=1013(建议看原文) 坦白说自定义事件在asp.net中用到的机率确实很低,但低并不代表没有用到。尤其是在做自定义控件的时候,嘿嘿,自定义事件几乎就不可避免地要用到。 记得以前在博客http://yeah888.blog.sohu.com/上写过一个关于自定义事件在asp.net中的使用的帖子。那个例子是不... 阅读全文
posted @ 2007-06-25 17:31 Elaine Shi 阅读(2018) 评论(1) 推荐(0) 编辑
摘要:作为启发,在收藏里面找or..http://andrewbao.cnblogs.com/archive/2005/01/28/98878.html可搜索类似 阅读全文
posted @ 2007-06-25 16:12 Elaine Shi 阅读(565) 评论(0) 推荐(0) 编辑
摘要:常用表达式:"^\d+$"  //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$"  //正整数 "^((-\d+)|(0+))$"  //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$"  //负整数 "^-?\d+$"    //整数 "^\d+(\.\d+)?$"  //非负浮点数(正浮点数 + 0) "^(([0-9]+\.[0-9]*[1-9... 阅读全文
posted @ 2007-05-14 11:26 Elaine Shi 阅读(918) 评论(4) 推荐(0) 编辑
摘要:面试题 C#面试基础问题 asp.net面试试题收集经典推荐--.Net面试法宝(面试题收集) ASP.NET面试的题目C# msdn参考 (荐) 阅读全文
posted @ 2006-06-09 16:10 Elaine Shi 阅读(1114) 评论(0) 推荐(0) 编辑
摘要:好久没有写BLOG,开发点滴全记在了本地,有时候也忘记去整理它。现在趁大家午睡的时候整理出来吧,也可以让大家提提不同的意见:)1. 一个方法实现类似htmlencode的方法functionHtmlEncode(text){returntext.replace(/&/g,'&amp').replace(/\"/g,'&quot;').replace(/</g,'&am... 阅读全文
posted @ 2006-03-15 13:16 Elaine Shi 阅读(3100) 评论(11) 推荐(0) 编辑
摘要:http://aspnet.4guysfromrolla.com/articles/081402-1.aspx 阅读全文
posted @ 2006-01-04 18:00 Elaine Shi 阅读(920) 评论(0) 推荐(0) 编辑
摘要:staticpublicstring[]SplitString(stringstr,stringseparator){stringtmp=str;Hashtableht=newHashtable();inti=0;intpos=tmp.IndexOf(separator);while(pos!=-1){ht.Add(i,tmp.Substring(0,pos));tmp=tmp.Substring... 阅读全文
posted @ 2005-12-22 08:56 Elaine Shi 阅读(1314) 评论(1) 推荐(0) 编辑
摘要:1. 从一个枚举值得到对应的串: //定义一个枚举enumColors{Red,Green,Blue,Yellow};//得到串System.Enum.GetName(System.Typetype,objectobj);Enum.GetName(typeof(Colors),3)//返回Yellow2. oracle: blob的读写方法write,read3. ref在置参前,一定要先给参数分... 阅读全文
posted @ 2005-12-14 17:58 Elaine Shi 阅读(4354) 评论(21) 推荐(0) 编辑
摘要:dropdownlist等控件的onchange事件,如果同时要触发js弹出框,则采用以下方法:后台:if(iStatusNo==(int)ZTE.EVAL.Model.EnumCollections.InvestigateStatus.已发布){this.ddlOperation.Items.Add(newListItem(OperType.预览.ToString(),pkValue));thi... 阅读全文
posted @ 2005-12-14 17:53 Elaine Shi 阅读(2002) 评论(1) 推荐(0) 编辑
摘要:有时候我们需要复制一个实体类,而又不希望两个使用同一个内存地址,我用了很简单的反射来实现这种功能:)/**////<summary>///设置实体对象的修改属性///</summary>///<paramname="obj"></param>///<returns></returns>publicvoidCloneEntity... 阅读全文
posted @ 2005-12-14 17:07 Elaine Shi 阅读(1236) 评论(0) 推荐(0) 编辑
摘要:publicstringGetRootPath(){//是否为SSL认证站点stringsecure=HttpContext.Current.Request.ServerVariables["HTTPS"];stringhttpProtocol=(secure=="on"?"https://":"http://");//服务器名称stringserverName=HttpContext.Curre... 阅读全文
posted @ 2005-12-07 13:40 Elaine Shi 阅读(4065) 评论(5) 推荐(1) 编辑
摘要:解决方案如下:http://support.microsoft.com/default.aspx?scid=kb;en-us;329065与索引服务相冲突,须停止索引服务,并重启IIS即可。 阅读全文
posted @ 2005-12-03 19:48 Elaine Shi 阅读(1062) 评论(0) 推荐(0) 编辑
摘要:相关的一些资料:网友提到的《asp.net 2.0 揭密》http://www.fixdown.com/soft/19605.asp这里有下载,不过我看了下觉得写的不是很好 不知道即将出炉的《ASP.NET 2.0高级编程》怎么样(1月初发售)http://www.china-pub.com/computers/common/info.asp?id=28152感觉现在学习的最好资料还是1、http... 阅读全文
posted @ 2005-12-03 10:50 Elaine Shi 阅读(808) 评论(1) 推荐(0) 编辑
摘要:是偶太笨吗...委托的文章看过几篇,曾经实践过一个早上,也成功过。可过了1,2个月还是忘记,始终无法真正理解委托的意思! 真伤心,超级挫败!比如两个同级的用户控件uc1和uc2, uc1_btnA的方法触发uc2_btnB的方法AddMatrixCallBackFunctionuc1://实现一个事件this.uc1_btnA.AddChick+=newuc2_btnB.AddMatrixEven... 阅读全文
posted @ 2005-11-21 14:23 Elaine Shi 阅读(665) 评论(1) 推荐(0) 编辑
摘要:检查一个字符串是否为空字符串使用Length来检查一个字符串是否为空。计算Length时,只需要检查内部数组的长度,不需要字节比较。比较字符串String.Equals方法来比较两个字符串 空字符串用String.Empty表示空字符串,不要用””。String.Empty的定义为public static readonly string Empty,编译时会转化成R... 阅读全文
posted @ 2005-11-15 23:58 Elaine Shi 阅读(594) 评论(0) 推荐(0) 编辑
摘要:简称 .NET类 类型 宽度 范围(位) byte System.Byte 无符号整数 8 -128 到 127 sbyte System.SByte 有符号整数 8 -128 到 127 int System.Int32 有符号整数 32 -2,147,483,648 到 2,147,483,647 uint System.UInt32 无符号整数 32 0 到 4294967295 short... 阅读全文
posted @ 2005-11-02 17:01 Elaine Shi 阅读(995) 评论(0) 推荐(0) 编辑
摘要:private void fileUpload_Click(object sender, System.EventArgs e) { // 模拟数据库里取出byte[]再显示缩略, // 模拟方法:先上传,把stream转成byte[],再把byte[]放在stream里,再输出 // 上传 Sy... 阅读全文
posted @ 2005-11-02 16:29 Elaine Shi 阅读(1084) 评论(0) 推荐(0) 编辑
摘要:可以在global文件中的application_error()中,记录用户操作中出现的异常日志 protected void Application_Error(Object sender, EventArgs e) { try { Exception exception = HttpContext.... 阅读全文
posted @ 2005-10-13 14:23 Elaine Shi 阅读(519) 评论(0) 推荐(0) 编辑
摘要:(待更新版本)现在working,先丢几个thread的bookmark,这几个慢慢研究先。C#的多线程机制探索http://www.vchome.net/dotnet/dotnetdocs/dotnet1.htm使用线程http://www.microsoft.com/china/msdn/archives/library/dv_vstechart/html/vbtchUsingThreads.aspJAVA中的线程 (量)http://www.chinaitpower.com/Dev/Programme/Java/Xiancheng/ 阅读全文
posted @ 2005-10-09 10:42 Elaine Shi 阅读(360) 评论(0) 推荐(0) 编辑
摘要:最近做的都是些杂活,总结出来的更偏重于一些vs.net的使用方法,不过挺有用的,怕以后忘记,丢出来先:) 1. options > source control > SCC > perform background status updates > 去掉,可以省去每次打开项目时自动进行后台版本控件的状态更新(这东东让VS。NET启动速度大大的慢) 2. 用过vs.net里的bookmark和nav... 阅读全文
posted @ 2005-10-08 17:21 Elaine Shi 阅读(2291) 评论(15) 推荐(0) 编辑