12 2010 档案

摘要:Delphi 从文件名中得到路径名,可用下面的两个函数,这两个函数有一点点微小的差别: ExtractFilePath(FileName:String) 该函数返回路径名,其结尾字符总是“/”ExtractFileDir(FileName:String) 该函数同样返回路径名,但不包括结尾的字符“/”,除非返回的路径是根目录。 样例代码: ShowMessage(ExtractFileDir(Application.Exename)); // 如: c:/temp ShowMessage(ExtractFilePath(Application.Exename)); // 如: c:... 阅读全文

posted @ 2010-12-30 13:40 严武 阅读(357) 评论(0) 推荐(0) |

摘要:在Delphi中,对于的关闭有free,close,closeQuery,Destroy,Terminate,halt等,它们的区别是什么?是不是还有别的关闭方法?Application.Terminate 中止应用程序的运行,比较安全。而Halt则完全停止程序,这种完全停止,会忽略任何try finally块、任何finalization语句块以及Delphi编译器自动编译优化的内存清理代码的执行,从而造成内存丢失。强烈建议不要使用Halt。 使用 Application.Terminate 还会触发一些事件,而Halt绝对不会 Application.Terminate 不会触发CLOSE 阅读全文

posted @ 2010-12-30 13:36 严武 阅读(589) 评论(0) 推荐(0) |

摘要:1330-1392-4985-8546-9491-1497 1330-1689-1499-0183-2808-9117 1330-1271-1886-6968-4767-8376 阅读全文

posted @ 2010-12-28 10:48 严武 阅读(423) 评论(0) 推荐(0) |

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace test{ public partial class Form3 : Form { public Form3() ... 阅读全文

posted @ 2010-12-25 16:21 严武 阅读(6439) 评论(0) 推荐(0) |

摘要://加边框 try { Bitmap Backbmp = new Bitmap(@"" + Path); float w = (float)(Backbmp.Width * 0.2); using (Graphics g = Graphics.FromImage(Backbmp)) { using (Brush brush = new SolidBrush(Color.FromArgb(0, 156, 255))) { using (Pen pen = new Pen(brush, w)) { pen.DashStyle = DashStyle.Custom; g.Draw 阅读全文

posted @ 2010-12-23 15:24 严武 阅读(571) 评论(0) 推荐(0) |

摘要:// 该调用是 Windows.Forms 窗体设计器所必需的。 InitializeComponent(); // TODO: 在 InitComponent 调用后添加任何初始化 this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); //开启双缓冲this.SetStyle(ControlStyles.DoubleBuffer,true); this.SetStyle(ControlStyles.UserPaint,true); this.SetStyle(ControlStyles.ResizeRedraw,true... 阅读全文

posted @ 2010-12-23 13:19 严武 阅读(2720) 评论(0) 推荐(0) |

摘要:#region 圆角界面 public void SetWindowRegion() { System.Drawing.Drawing2D.GraphicsPath FormPath; FormPath = new System.Drawing.Drawing2D.GraphicsPath(); Rectangle rect = new Rectangle(0, 0, this.Width, this.Height);//this.Left-10,this.Top-10,this.Width-10,this.Height-10); FormPath = GetRoundedRectPath(r 阅读全文

posted @ 2010-12-23 12:38 严武 阅读(538) 评论(0) 推荐(0) |

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Runtime.InteropServices;namespace test{ public partial class Form3 : Form { public Form3() { InitializeComponen 阅读全文

posted @ 2010-12-23 12:33 严武 阅读(3090) 评论(1) 推荐(0) |

摘要:(1)NULLnull 关键字是表示不引用任何对象的空引用的文字值。null 是引用类型变量的默认值。那么也只有引用型的变量可以为NULL,如果int i=null,的话,是不可以的,因为Int是值类型的。(2)""和String.Empty 这两个都是表示空字符串。只不过""理论上重新开辟内存空间,而String.Empty指向一处。不过优化器会优化的! string.Empty不分配存储空间, ""分配一个长度为空的存储空间,所以一般用string.Empty,为了以后跨平台,还是用string.empty。在C# 中,大多数情况 阅读全文

posted @ 2010-12-22 11:29 严武 阅读(15880) 评论(0) 推荐(2) |

摘要:http://www.zsqn.com/Msg/ViewMsg.aspx?id=18571http://hi.baidu.com/bleat312/blog/item/0b482b29fbd75ff699250ae7.html 阅读全文

posted @ 2010-12-22 11:21 严武 阅读(117) 评论(0) 推荐(0) |

摘要:一、用TCriticalSection类来阻塞。(ps:这里的咚咚都涉及Win32编程,我对这些不了解,先掌握如何运用吧。)这个有点类似临界区。要Uses SyncObjs单元。1、声明一个全局的TCriticalSection类的实例。2、建立TCriticalSection.Create,最好是在程序onCreate里面,这样才能保证对所有线程进行控制。3、在全局变量访问前用TCriticalSection.Acquire或TCriticalSection.Enter来阻塞。4、访问完毕,用TCriticalSection.Release或TCriticalSection.Leave来解除 阅读全文

posted @ 2010-12-22 11:15 严武 阅读(2347) 评论(0) 推荐(1) |

摘要:三层架构指的是界面,业务逻辑和数据存储分离,不是指物理上是否分离。 这样做的好处是层次分明,维护好做,系统资源也好分布式处理。 数据库层哪就不说了,用MSSQL、Orcale随你了,就是数据服务层 业务逻辑的话要分析清楚,就是中间层 界面,也叫客户端。这里就是得到数据和显示数据的部分了,不做其它处理。但是数据有效性分析最好放在界面层,以充分利用客户端的性能。不然的话业务逻辑层的负担太大也会形成瓶劲。 数据库的建立不说了。 三层体系的建立 一 数据库层的建立 使用sqlserver或orale建立数据库。 二 中间层的建立 ... 阅读全文

posted @ 2010-12-22 11:13 严武 阅读(395) 评论(0) 推荐(0) |

摘要:1. MOUSEHOOKSTRUCT 鼠标钩子结构体 当WH_MOUSE钩子处理的鼠标事件时,该结构包含鼠标信息。 typedef struct { POINT pt; HWND hwnd; UINT wHitTestCode; ULONG_PTR dwExtraInfo; } MOUSEHOOKSTRUCT, *PMOUSEHOOKSTRUCT; 参数: pt : POINT结构对象,保存鼠标在屏幕上的x,y坐标 hwnd: 接收到鼠标消息的窗口的句柄 wHitTestCode: hit-test值,详细描述参见WM_NCHITTEST消息 dwEx... 阅读全文

posted @ 2010-12-22 10:58 严武 阅读(958) 评论(0) 推荐(0) |

摘要:/// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { System.Diagnostics.Process[] ps = System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName); if (ps.Length <= 1) ... 阅读全文

posted @ 2010-12-10 22:12 严武 阅读(304) 评论(0) 推荐(0) |

摘要:select语句中只能使用sql函数对字段进行操作(链接sql server),select 字段1 from 表1 where 字段1.IndexOf("云")=1;这条语句不对的原因是indexof()函数不是sql函数,改成sql对应的函数就可以了。left()是sql函数。select 字段1 from 表1 where charindex('云',字段1)=1; 字符串函数对二进制数据、字符串和表达式执行不同的运算。此类函数作用于CHAR、VARCHAR、 BINARY、 和VARBINARY 数据类型以及可以隐式转换为CHAR 或VARCHAR的 阅读全文

posted @ 2010-12-10 19:23 严武 阅读(345) 评论(0) 推荐(0) |

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3