2006年12月10日

关于状态模式的思考

摘要: 今天是星期天,照着深入浅出设计模式中的状态模式,有如下心得:发现,状态模式它的应用范围是解决一个对象的状态问题(并且这个状态的主体的状态是循环变化的,可以由A变成B,然后B变成C,然后C再变成A等等),而我们平常接触的单据的状态,是不可以用状态模式去解决问题的。第二,状态,并不简单是一个标识字段,对于它的客户端来说,它应该包括行为,因为行为改变状态,并且这种行为与状态的主体共享一个接口,当主体操作... 阅读全文

posted @ 2006-12-10 15:04 戴玮 阅读(263) 评论(0) 推荐(0) 编辑

2006年11月15日

实在是忍受不了MSN的巨慢速度,重新换个地方

摘要: 把以前在MSN个人空间的贴子部分导出来,贴在现在的博客园里面。希望这个好一些。 阅读全文

posted @ 2006-11-15 12:54 戴玮 阅读(151) 评论(0) 推荐(0) 编辑

如果在网页中实现查找功能

摘要: 有什么问题请到<a href='/bbs/forums.php?fid=21'>论坛</a>中发表<br><!--# 特效来源:http://www.webjx.com/js --><!-- 把如下代码加入<body>区域中 -->你可以输入'脚本'查查看<BR>有<br><br><b... 阅读全文

posted @ 2006-11-15 12:48 戴玮 阅读(357) 评论(0) 推荐(0) 编辑

asp.net2.0 页面生命周期方法

摘要: asp.net2.0 页面生命周期方法 大杂烩-.NET asp.net2.0 页面生命周期方法 方法 活动 Constructor Always Construct Always TestDeviceFilter Always AddParsedSubObject Always DeterminePostBackMode Always OnPreInit Always LoadPersonali... 阅读全文

posted @ 2006-11-15 12:46 戴玮 阅读(245) 评论(0) 推荐(0) 编辑

C#加密与解决

摘要: using System;using System.Collections.Generic;using System.Text;using System.Security.Cryptography;using System.IO;namespace Secrituy{ public class Secure { private static byte[] DESKey = new byte[]{1... 阅读全文

posted @ 2006-11-15 12:45 戴玮 阅读(230) 评论(0) 推荐(0) 编辑

如何自定义一个模板列,并在后台加载

摘要: public class EditTemplateColumn : ITemplate{ public EditTemplateColumn(string colname) { m_strColName = colname; } public void InstantiateIn(Control container) { Label edt = new Label(); edt.DataBindi... 阅读全文

posted @ 2006-11-15 12:44 戴玮 阅读(242) 评论(0) 推荐(0) 编辑

ASP.NET常用的代码集合

摘要: 4月17日7.表格点击改变颜色if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem){ e.Item.Attributes.Add("onclick","this.style.backgroundColor=’#99cc00’;   this.style.co... 阅读全文

posted @ 2006-11-15 12:43 戴玮 阅读(244) 评论(0) 推荐(0) 编辑

触发器示例代码

摘要: SET QUOTED_IDENTIFIER ON GOSET ANSI_NULLS ON GOALTER trigger SalesOrderD_T_Checking on dbo.SalesOrderDfor insert , updateasdeclare @a intif exists(select * from inserted inner join SalesOrderH on inse... 阅读全文

posted @ 2006-11-15 12:41 戴玮 阅读(308) 评论(0) 推荐(0) 编辑

ADO.NET2.0分页

摘要: SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=Northwind;Integrated Security=True"); SqlCommand comm = conn.CreateCommand(); SqlDataAdapter adape = new SqlDataAdapter(comm); com... 阅读全文

posted @ 2006-11-15 12:40 戴玮 阅读(234) 评论(0) 推荐(0) 编辑

如何查找 Office Web 组件 (OWC) 编程文档和示例

摘要: http://support.microsoft.com/default.aspx?scid=kb;zh-cn;319793使用 Office Web 组件参考文档下表显示了由 Office Web 组件安装的帮助文件。要打开这些帮助文件,请在 Windows 资源管理器中定位到相应的目录,然后双击所需的文件。 组件名称 Office Web Components 9.0 Office XP We... 阅读全文

posted @ 2006-11-15 12:39 戴玮 阅读(612) 评论(0) 推荐(0) 编辑

如何将枚举定义翻译成DataTable

摘要: public static string TransactionEnum(string fieldName, Type enumType) { return TransactionEnum(fieldName, enumType, null); } public static string TransactionEnum(string fieldName, Type enumType, strin... 阅读全文

posted @ 2006-11-15 12:37 戴玮 阅读(269) 评论(0) 推荐(0) 编辑

网页中调用MSN添加好友工具

摘要: <object id=MsgrUIA classid=clsid:B69003B3-C55E-4b48-836C-BC5946FC3B28 codeType=application/x-oleobject width=0 height=0></object>jsfunction addMSN(server_type) {//alert(server_type);//retu... 阅读全文

posted @ 2006-11-15 12:34 戴玮 阅读(855) 评论(1) 推荐(0) 编辑

如何在XP SP2下面使用DTC

摘要: 1、安装MSMQ服务 2、进入组件服务,进行安全性配置 3、验证SQL SERVER DTC 阅读全文

posted @ 2006-11-15 12:33 戴玮 阅读(305) 评论(0) 推荐(0) 编辑

Javascript 复制与粘贴

摘要: <a href="javascript:" onclick="clipboardData.setData('Text','https://bbs5.news.163.com/board/rep.jsp?b=school&i=68827&p=0')">复制</a> <a href="javascript:alert(clipboardData.getDa... 阅读全文

posted @ 2006-11-15 12:32 戴玮 阅读(1617) 评论(0) 推荐(0) 编辑

如何在Component中取得Page对象

摘要: 使用CompontDesigner即可。并重写其中的Initialize方法例如using System;using System.ComponentModel;using System.ComponentModel.Design;using System.Web.UI;using System.Web.UI;namespace aaa{ public class WebTimer2Designe... 阅读全文

posted @ 2006-11-15 12:31 戴玮 阅读(302) 评论(0) 推荐(0) 编辑

使用TransactionScope进行COM+事务处理

摘要: using (TransactionScope ts = new TransactionScope()) { NewBusiness.NewUser obj = new NewBusiness.NewUser(); obj.DataRow["uname"] = "david11ww1"; obj.Save(); ts.Complete(); } 阅读全文

posted @ 2006-11-15 12:30 戴玮 阅读(276) 评论(1) 推荐(0) 编辑

如何在C#中使用EVAL方法

摘要: decimal a = 1;decimal b = 2;string ev = "a + b";System.Data.DataTable dt = new System.Data.DataTable();dt.Columns.Add("a",typeof(decimal));dt.Columns.Add("b",typeof(decimal));dt.Rows.Add(new object[]{... 阅读全文

posted @ 2006-11-15 12:28 戴玮 阅读(1344) 评论(2) 推荐(0) 编辑

巨NB的JAVASCRIPT代码

摘要: <HTML><BODY><SCRIPT LANGUAGE="JAVASCRIPT">function addcell() //添加新的单元格{//插入新的一行oTargetRow = document.all("mytable1").insertRow();for(var k = 0; k < document.all("mytable1").rows(0... 阅读全文

posted @ 2006-11-15 12:28 戴玮 阅读(328) 评论(1) 推荐(0) 编辑

9月25日C#->WebService中如何传递文件

摘要: 9月25日怎样使用WebService传输文件? 这里有两个办法 一个是使用byte[]传递,一个是使用WSE附件传递 前面一个: [WebMethod] public byte[] GetFileData(string requestFileName) { // 这里打开一个文件,返回文件的byte[] } [WebMethod] public void SetFileData(byte[] d... 阅读全文

posted @ 2006-11-15 12:27 戴玮 阅读(1422) 评论(0) 推荐(0) 编辑

解决了一年多的问题,狂喜(一年之前)

摘要: 今天用了一下午的时间,终于解决了C#通过WORD模板来自动生成WORD文档,以便于客户端打印的测试代码.原理就是在WORD里面写宏,然后在C#里面调用这些宏.晚上测试终于,心里很开心.object oMissing = System.Reflection.Missing.Value;Microsoft.Office.Interop.Word.Application oWord = new Micr... 阅读全文

posted @ 2006-11-15 12:25 戴玮 阅读(312) 评论(0) 推荐(0) 编辑

如果通过XMLHTTP取得WEB数据

摘要: <script language="javascript">function getData(){try{var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");var url = "a.xml";xmlhttp.open("Get",url,false);xmlhttp.send();var xmldoc = xmlhttp.res... 阅读全文

posted @ 2006-11-15 12:23 戴玮 阅读(210) 评论(0) 推荐(0) 编辑

导航