上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 模拟String,让引用类型的使用像值类型一样 class MyString { private static Dictionary<string, MyString> dic = new Dictionary<string, MyString>(); string s; public MyString(string s) { this.s = s; dic[s] = this; } public static implicit operator MySt... 阅读全文
posted @ 2012-04-03 23:20 Bug山Bug海 阅读(307) 评论(0) 推荐(0)
摘要: 一般反射接口定义在单独一个程序集内,第三方程序集引用接口并实现接口,并在宿主通过反射得到类型调用 接口程序集: ILog接口: public interface ILog { void WriteErrorEvent(string errorMessage); void WriteApplicationEvent(string applicationMessage); void WriteSecurityEvent(string securityMessage); }第三方程序集:public class MyLog:ILog ... 阅读全文
posted @ 2012-03-26 22:45 Bug山Bug海 阅读(242) 评论(0) 推荐(0)
摘要: 预处理标示特性 Conditional Conditional 应用于方法以启用或禁用程序特定的诊断信息的显示:#define TRACE_ONusing System;using System.Diagnostics;public class Trace{ [Conditional("TRACE_ON")] public static void Msg(string msg) { Console.WriteLine(msg); }}public class ProgramClass{ static void Main() { T... 阅读全文
posted @ 2012-03-26 20:56 Bug山Bug海 阅读(283) 评论(0) 推荐(0)
摘要: SQL Server 2005没有直接生成表内容的脚本功能需要手动实现View Code CREATE PROCEDURE dbo.UspOutputData @tablename sysname AS BEGIN declare @column varchar(1000) declare @columndata varchar(1000) declare @sql varchar(4000) declare @xtype tinyint declare @name sysname declare @... 阅读全文
posted @ 2012-03-23 21:36 Bug山Bug海 阅读(236) 评论(0) 推荐(0)
摘要: 在web.config中的 <system.web> </system.web>内加入如下代码: <httpRuntime executionTimeout="600" maxRequestLength="951200" useFullyQualifiedRedirectUrl="true" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" e 阅读全文
posted @ 2012-03-20 11:40 Bug山Bug海 阅读(189) 评论(0) 推荐(0)
摘要: 在开发Web程序时,需要监听http连接,看看数据的底层数据传输有没有发生异常。这对于AJAX开发来说更为重要。网上这类的工具有许多,IE和FF两个阵营都有许多工具可选。不过对于IE阵营,虽然工具功能强大,但大多为商业软件,即要收money的。不过,有一款功能强大且免费的工具可以选择:fiddler2。它基于.NET Framework开发,功能丝毫不弱于商业软件。不过fiddler2默认不监听本地的http连接,如果域名localhost,则不进行监听。在IIS上,可以把一个网站与一个IP挂钩,这样通过IP来访问网站,fiddler2可以正常进行监听。不过手打IP确实有点痛苦。其实,只要域名 阅读全文
posted @ 2012-03-20 11:04 Bug山Bug海 阅读(791) 评论(0) 推荐(0)
摘要: <%@ Page Language="C#" AutoEventWireup="true" %><%@ Import Namespace="System.Runtime.InteropServices" %><%@ Import Namespace="System.IO" %><%@ Import Namespace="System.Data" %><%@ Import Namespace="System.Reflection&qu 阅读全文
posted @ 2012-03-20 10:09 Bug山Bug海 阅读(407) 评论(0) 推荐(0)
摘要: 数据绑定控件中模板中使用服务端控件时,属性中有数据绑定只能是<%#Eval()%>前面不能加其他内容如需要设置"~\Dir\<%#Eval()%>"需要在后置文件定义一个处理函数 protected string ConvertStr(object str) { return @"~\Dir\" + str; }aspx中调用<%#ConvertStr(Eval("BindingField"))%> 阅读全文
posted @ 2012-03-19 19:39 Bug山Bug海 阅读(135) 评论(0) 推荐(0)
摘要: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1" onitemdatabound="Repeater1_ItemDataBound"> <ItemTemplate> <asp:Label ID="LabelName" runat="server" Text='<%#Eval("NickName") %>& 阅读全文
posted @ 2012-03-19 18:24 Bug山Bug海 阅读(161) 评论(0) 推荐(0)
摘要: Slider控件如果设置过Value,在XAML中设置ValueChanged事件会出错,需要在load中编码设置 阅读全文
posted @ 2012-03-19 10:38 Bug山Bug海 阅读(119) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页