随笔分类 -  学习笔记

1
常用正則表達式
摘要:(\d{3}-|\d{4}-)?(\d{8}|\d{7})? //国内电话^[1-9]*[1-9][0-9]*$ //腾讯QQ^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$ //email地址 ^[a-zA-z]+://(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))*(\\?\\S*)?$ //url^\d+$ ... 阅读全文
posted @ 2004-10-12 12:31 hi-justin 阅读(844) 评论(0) 推荐(0)
[討論]請問大家在這種情況是怎麼樣來進行並發處理的?
摘要:如:在系統中某一用戶對一單據進行修改並准備在保存後對這筆單據執行其他動作,但在執行其他動作之前,另外一個用戶也對這種單據進行修改在這種情況下我是這樣子來做的: 在相關Table中加入一個字段LockSign 類型為timestamp 在加載這筆單據數據的時候,把LockSign的值記下,然後在他執行其他動作的時候判斷已取出的這個LockSign的值與現在DB中這個LockSign的值是否相同,如... 阅读全文
posted @ 2004-09-10 15:38 hi-justin 阅读(1316) 评论(15) 推荐(0)
[收藏]
摘要:------------------------- 阅读全文
posted @ 2004-09-08 10:00 hi-justin 阅读(569) 评论(0) 推荐(0)
五种提高 SQL 性能的方法 [来源:MSDN Johnny Papa]
摘要:有时, 为了让应用程序运行得更快,所做的全部工作就是在这里或那里做一些很小调整。啊,但关键在于确定如何进行调整!迟早您会遇到这种情况:应用程序中的 SQL 查询不能按照您想要的方式进行响应。它要么不返回数据,要么耗费的时间长得出奇。如果它降低了报告或您的企业应用程序的速度,用户必须等待的时间过长,他们就会很不满意。就像您的父母不想听您解释为什么在深更半夜才回来一样,用户也不会听你解释为什么查询耗... 阅读全文
posted @ 2004-09-07 11:06 hi-justin 阅读(1602) 评论(6) 推荐(0)
设计模式学习笔记(三)
摘要:/* Notes: * Coupling between classes and class libraries is a major maintenance * headache. To ease this problem, often the client talks to an * abstraction description, which in turn calls an imple... 阅读全文
posted @ 2004-06-03 14:51 hi-justin 阅读(462) 评论(0) 推荐(0)
设计模式学习笔记(二)
摘要:/* Notes: * Adapters are often used when client code is written to expect classes * from one framework, and it meant to work with classes from a totally * different framework. Assume you cannot chan... 阅读全文
posted @ 2004-06-03 14:51 hi-justin 阅读(451) 评论(0) 推荐(0)
设计模式学习笔记(一)
摘要:/* Notes: * When the construction needed involves many objects, possible organised * in multi-faceted arrangements, the entire construction can be delegated * to an abstract factory. This exposes stan... 阅读全文
posted @ 2004-06-03 14:50 hi-justin 阅读(537) 评论(0) 推荐(0)
[收藏]C#中一些字符串操作的常用用法
摘要://获得汉字的区位码 byte[] array = new byte[2]; array = System.Text.Encoding.Default.GetBytes("啊"); int i1 = (short)(array[0] - ''\0''); int i2 = (short)(array[1] - ''\0''); //unicode解码方式下的汉字码 array = Sy... 阅读全文
posted @ 2004-05-26 22:39 hi-justin 阅读(4974) 评论(2) 推荐(0)
使用GDI+在同一行上画字体大小不同的字符,我靠,搞得我发黑眼晕哒
摘要:// clear the background Graphics g = this.CreateGraphics(); g.Clear(Color.AliceBlue); // create a pen Pen pen = new Pen(Color.Red, 1f); // the string to be drawn string s = "S"; ... 阅读全文
posted @ 2004-05-26 11:13 hi-justin 阅读(1347) 评论(0) 推荐(0)
RTF格式分析结果
摘要:RTF格式分析详表 标记名称 定义 \QL 左对齐 \QC 居中对齐 \QR 右对齐 \FS 字体大小(如:\fs20即为10号字体) \FONTTBL 字体列表 \b 标记后面的内容以粗体显示 \b0 标记后面的内容不以粗体显示 \i 标记后面的内容以斜体显示 \i0 标记后面的内容不以斜体显示 \ul 标记以后的内容以... 阅读全文
posted @ 2004-05-26 08:49 hi-justin 阅读(4551) 评论(7) 推荐(0)
(收藏)在ASP.NET中实现Model-View-Controller模式(五)
摘要:测试 将模型部分从ASP.NET环境中分离出来能够使模型部分更容易的被测试。在ASP.NET环境中进行测试的话,你必须同时测试很多方面,如HTML代码是否正确,而读取HTML代码的工作是非常烦闷的。将模型部分分离出来,使你能够对模型部分做单独的单元测试。下面是NUnit (http://nunit.org)对模型部分进行单元测试的例子。 using System; using NUnit.... 阅读全文
posted @ 2004-05-24 19:12 hi-justin 阅读(474) 评论(0) 推荐(0)
(收藏)在ASP.NET中实现Model-View-Controller模式(四)
摘要:模型-视图-控制器分离的重构 为了解决上面所遗留的问题,你必须将模型与控制器角色分离。 视图的实现代码与前部分相同。 模型 下面的代码例子使模型角色仅仅依赖于数据库,而不包含任何与视图相依赖的代码。 using System; using System.Collections; using System.Data; using System.Data.SqlClient; public cla... 阅读全文
posted @ 2004-05-24 19:12 hi-justin 阅读(463) 评论(0) 推荐(0)
(收藏)在ASP.NET中实现Model-View-Controller模式(三)
摘要:模型及控制器部分: 这个解决方案的第二个部分是被隐藏的后台代码: using System; using System.Data; using System.Data.SqlClient; public class Solution : System.Web.UI.Page { protected System.Web.UI.WebControls.Button submit; ... 阅读全文
posted @ 2004-05-24 19:11 hi-justin 阅读(453) 评论(0) 推荐(0)
(收藏)在ASP.NET中实现Model-View-Controller模式(二)
摘要:MVC模式形容这种实现方式是一种被动的实现机制,ASP.NET充当了程序执行中的控制器的角色,但程序员必须将具体的事件处理方法添加到事件的响应函数中。如在这个例子中,控制器在页面加载之前调用Page_Load函数并执行其中的代码,当用户点击Submit按钮时由系统调用SubmitBtn_Click函数并执行。 这种将代码都包含在一个文件中的实现方式非常的直接,而且当应用程序很小并不经常修改的时... 阅读全文
posted @ 2004-05-24 19:10 hi-justin 阅读(485) 评论(0) 推荐(0)
(收藏)在ASP.NET中实现Model-View-Controller模式(一)
摘要:背景: 当利用ASP.NET创建Web应用程序时,基于程序的复杂性,必须把程序分割成不同的部分以减少代码的重复及减少日后变革时所引起的改动。 实现策略: 为了解释如何在ASP.NET中实现(MVC)模型-视图-控制器模式,以及说明将软件分离成模型、视图、及控制器角色的好处,在此以一个示例程序为例进行说明。这个示例程序是一个带有下拉框的单页程序,它的功能是显示数据库中的数据。如下图。 当... 阅读全文
posted @ 2004-05-24 19:09 hi-justin 阅读(521) 评论(0) 推荐(0)
》》》
摘要:/// /// 将ANSI编码转换成字符 /// /// 表示字符的第一个字节信息 /// 表示字符的第二个字节信息 /// 转换得到的字符 public string ToAnsi(string b1,string b2) { byte[] b={ (byte)int.Parse(b1, System.Globalization.NumberStyles.He... 阅读全文
posted @ 2004-05-24 12:34 hi-justin 阅读(439) 评论(0) 推荐(0)
郁闷了大半天,终于搞定了,把用户输入的内容转换成XML格式信息,在内存中创建XmlDocument
摘要:/// /// 在内存中以XML格式生成所有用户输入信息 /// /// 返回XmlDocument对象 private XmlDocument SaveToXml() { this.xmlString = ""; PreFontName = this.EditBox.SelectionFont.Name;//前一个字的字体 PreFontSize = this.Ed... 阅读全文
posted @ 2004-05-19 21:07 hi-justin 阅读(1769) 评论(1) 推荐(0)
Save Picture from Clipboard to file using C#
摘要:As you know The clipboard is a set of functions and messages that enable applications to transfer data. Because all applications have access to the clipboard, data can be easily transferred between ap... 阅读全文
posted @ 2004-05-14 16:31 hi-justin 阅读(2897) 评论(1) 推荐(0)
好多好多.NET技术资源网站,好东东得马上收藏!
摘要:名称:快速入门地址:http://chs.gotdotnet.com/quickstart/描述:本站点是微软.NET技术的快速入门网站,我们不必再安装.NET Framework中的快速入门示例程序,直接在网上查看此示例即看。****************************************************名称:微软官方.NET指导站点地址:http://www.gotdo... 阅读全文
posted @ 2004-05-14 16:18 hi-justin 阅读(801) 评论(0) 推荐(0)
导出数据到Excel
摘要:/// /// 导出数据到一个excel文件 /// /// 文件名称 public string ExportToExcel() { //You use these variables throughout the application. string fileExcel; string fileName; string strLine; FileStre... 阅读全文
posted @ 2004-05-13 14:55 hi-justin 阅读(2023) 评论(1) 推荐(0)

1