随笔分类 - C#
摘要:IntroductionBlogEngine.NET is an open source .NET blogging project that was born out of desire for a better blog platform. A blog platform with less complexity, easy customization, and one that takes advantage of the latest .NET features.BlogEngine.NET was designed using the current .NET framework a
阅读全文
摘要:1: DateTime start1 = DateTime.Parse(TextBox1.Text); 2: 3: DateTime end1 = DateTime.Parse(TextBox2.Text); 4: 5: DateTime start2 = DateTime.Parse(TextBox3.Text); 6: 7: DateTime end2 = DateTime.Parse(TextBox4.Text); 8: 9: TimeSpan ts1 = start2 - start1; 10: 11: TimeSpan ts2; 12: 13: if (ts1.Ticks >
阅读全文
摘要:asp.net,javascript,RequiredFieldValidator,DetailsView,CommandField.
为CommandField注册脚本
阅读全文
摘要:今天碰到一个问题,其实之前也有碰到过。在visual studio 2010创建控制台程序的时候(其它项目还不知道会不会有同样的问题)。添加log4net.dll引用,随便写点代码,如:[代码]编译,通不过,Error1The type or namespace name 'log4net' could not be found (are you missing a using directive or an assembly reference?)C:\Users\Joe\Desktop\sample\sample\ConsoleApplication1\Program.cs57Consol
阅读全文
摘要:windows service代码 inno setup 代码
阅读全文
摘要:Some of you read that code and are thinking to yourself, “String concatenation!? Are you kidding?” Yeah, we could use a StringBuilder, but for a small number of concatenations, concatenating a string ...
阅读全文
摘要:Track your visitors using an HttpModule
阅读全文
摘要:The reference rates are usually updated by 3 p.m. C.E.T. They are based on a regular daily concertation procedure between central banks across Europe and worldwide, which normally takes place at 2.15 ...
阅读全文
摘要:出处:Simple FTP file upload in C# 2.0
阅读全文
摘要:为什么要使用FindByValue而不使用SelectedValue??? 假设this.DropDownList1.SelectedValue == "1",即选择的是b。若传入的值为"A” 使用FindByValue则this.DropDownList1.SelectedValue还是等于“1”,即还是选择的是第二项没有改变。(操作者以为是传入正确的...
阅读全文
摘要:method 1: method 2: behind-code
阅读全文
摘要:将DataSet转换为xml时,若DataSet某一列全部为dbnull时,方法1不会丢失该列,方法2会丢失该列。方法1:using (StringWriter sw = new StringWriter()) { ds.WriteXml(sw, XmlWriteMode.WriteSchema); ReturnXml = sw.ToString(); return ReturnXml; }方法2...
阅读全文
摘要:string JavaScriptStringEncode(string value){ if (string.IsNullOrEmpty(value)) { return string.Empty; } StringBuilder builder = null; int startIndex = 0; int count = 0; for (int i = 0; i < value.Len...
阅读全文
摘要:错误:Internal Server Error. This can include HTTP Error 500.22, and HTTP Error 500.23: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. This occurs because A...
阅读全文
摘要:匹配任意嵌套的html标签[代码]详见:使用正则表达式匹配嵌套Html标签
阅读全文
摘要:如何:创建 Windows Communication Foundation 客户端这是创建基本 Windows Communication Foundation (WCF) 服务和可以调用该服务的客户端所需的六项任务中的第四项任务。有关全部六项任务的概述,请参见入门教程主题。本主题描述如何检索 WCF 服务中的元数据,以及如何使用这些元数据创建可以访问该服务的 WCF 代理。此任务是通过使用 W...
阅读全文
摘要:In order to for the client to communicate with a WCF service, we need a proxy object. This can be quite a daunting task (and a little complicated to be honest). Luckily like a lot of things in .NET 3....
阅读全文
摘要:方法、实例构造函数、索引器和运算符是由它们的签名来刻画的: 方法签名由方法的名称和它的每一个形参(按从左到右的顺序)的类型和种类(值、引用或输出)组成。需注意的是,方法签名既不包含返回类型,也不包含 params 修饰符(它可用于最右边的参数)。实例构造函数签名由它的每一个形参(按从左到右的顺序)的类型和种类(值、引用或输出)组成。具体说来,实例构造函数的签名不包含可为最右边的参数指定的 para...
阅读全文
摘要:C#接口编程实例向你讲述了事件与接口的联合应用很多初学C#的朋友对于事件与接口感到迷惑不解,不明白它们之间的关系,下面我就用实例来简单的分析讲解一下。C#接口编程实例问题的解决之前我们来看看事件的创建过程,用event修饰符来代表一个事件,我们要创建一个C#事件必须按以下顺序来扫行:C#接口编程实例1,创建或标识一个代表。比如下例中的publicdelegatevoiddele(); //声明代表...
阅读全文