2010年3月22日
摘要: select name from master..sysdatabases 阅读全文
posted @ 2010-03-22 22:11 WPF之家 阅读(157) 评论(0) 推荐(0) 编辑
摘要: --创建链接服务器 exec sp_addlinkedserver 'srv_lnk','','SQLOLEDB','远程服务器名或ip地址' exec sp_addlinkedsrvlogin 'srv_lnk','false',null,'用户名','密码' exec sp_serveroption 'srv_lnk','rpc out','true... 阅读全文
posted @ 2010-03-22 21:48 WPF之家 阅读(199) 评论(0) 推荐(0) 编辑
摘要: --> Title : 动态T-SQL语句常見問題與解決方案 --> Author : wufeng4552 --> Date : 2009-11-24 10:11:10 if object_id('[tb]') is not null drop table [tb] go create table [tb] (dt nvarchar(20),ID int) insert into [tb... 阅读全文
posted @ 2010-03-22 21:43 WPF之家 阅读(173) 评论(0) 推荐(0) 编辑
摘要: --当天的星期因为得到的 weekday 比实际的多一天 所以当天减去一天 才能得到正确的星期 数 select DatePart(weekday, dateadd(dd,-1,getdate())) --本周一的日期 select convert(varchar(10),dateadd(dd,-(DatePart(weekday, dateadd(dd,-1,getdate()... 阅读全文
posted @ 2010-03-22 21:26 WPF之家 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 我心中的十大信息化软件开发技术 这是我2010年发表的第一篇博文,算是对我这十年所用软件开发技术的一些总结吧。由于个人知识有限,希望与大家共同讨论,讨论的主题可以是所列技术的分析,其它前沿技术的分析等等。 注: 1、主题是开发领域,不包括UML等建模设计技术、测试技术等等;2、主要是信息化软件开发技术,不包括互联网、游戏及嵌入式开发等领域;3、所列技术目前还是主流开发技术,并且已经得到... 阅读全文
posted @ 2010-03-22 21:14 WPF之家 阅读(274) 评论(0) 推荐(0) 编辑
摘要: [C#动态调用C++编写的DLL函数] by jingzhongrong 2008-05-08动态加载DLL需要使用Windows API函数:LoadLibrary、GetProcAddress以及FreeLibrary。我们可以使用DllImport在C#中使用这三个函数。 [DllImport("Kernel32")]public static extern int Get... 阅读全文
posted @ 2010-03-22 21:01 WPF之家 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 注册一个AppBar(什么是AppBar?Using Application Desktop Toolbars ),通过SHAppBarMessage向系统注册AppBar,这样,当有程序全屏运行时系统会向我们的程序发送消息,在窗体WndProc中处理即可。 声明要使用到的API和常量: view plaincopy to clipboardprint?public class APIWrappe... 阅读全文
posted @ 2010-03-22 20:55 WPF之家 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 1. XML文件的读取1XML文件格式如下: //xml文件所在路径private readonly static string xmlFilePath = @"..\..\DvrOut\path.xml"; private readonly static XmlDocument document = new XmlDocument(); /// ///获取XML中文件的保... 阅读全文
posted @ 2010-03-22 20:52 WPF之家 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 运行这个程序之前要慎重考虑,因为关闭程序的方式是强制关闭。 进程可在资源管理器中查到(不要后面的.exe,只写前面的名) string in_sAppName = "WINWORD"; //(一个word文档程序) try { System.Diagnostics.Process[] psiNewcas = System.Diagnostics.Process.GetProc... 阅读全文
posted @ 2010-03-22 20:46 WPF之家 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 转义符 字符名\' 单引号\" 双引号\\ 反斜杠\0 空字符\a 感叹号(Alert )\b 退格\f 换页\n 新行\r 回车\t 水平 tab\v 垂直tab 阅读全文
posted @ 2010-03-22 20:45 WPF之家 阅读(227) 评论(0) 推荐(0) 编辑
摘要: using System.Security.Cryptography; private static string MD5ToString(String argString) { MD5 md5 = new MD5CryptoServiceProvider(); byte[] data = System.Text.Encoding.Default.GetBytes(argString);... 阅读全文
posted @ 2010-03-22 20:42 WPF之家 阅读(313) 评论(0) 推荐(0) 编辑
摘要: System.Text.RegularExpressions.Regex.IsMatch(argValue, "[A-Z]") System.Text.RegularExpressions.Regex.IsMatch(argValue, "[0-9]") System.Text.RegularExpressions.Regex.IsMatch(argValue, "[a-z]") System.T... 阅读全文
posted @ 2010-03-22 20:39 WPF之家 阅读(679) 评论(0) 推荐(0) 编辑
摘要: 字符转ASCII码: public static int Asc(string character) { if (character.Length == 1) { System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); int intAsciiCode = (int)asciiEnc... 阅读全文
posted @ 2010-03-22 20:33 WPF之家 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 今天用到这个,网上找个不错的,保存下来。 注意:这个方法是快速关机,不会保存你的任何未保存信息。 // 这个结构体将会传递给API。使用StructLayout [StructLayout(LayoutKind.Sequential, Pack = 1)] internal struct TokPriv1Luid { ... 阅读全文
posted @ 2010-03-22 20:32 WPF之家 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 发现窗体的位置只能通过StartPosition属性设置,而这个属性只提供了5种位置选项,很不够! 今天在网上找到了一个解决的方法,如下: int x= System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Size.Width/2;int y=System.Windows.Forms.Screen.PrimaryScreen.WorkingA... 阅读全文
posted @ 2010-03-22 20:24 WPF之家 阅读(240) 评论(0) 推荐(0) 编辑
摘要: foreach (Control c in this.Controls) { if (c is TextBox) { ((TextBox)c).Clear(); } else if(c is Label) { ~~~~~~ } } 阅读全文
posted @ 2010-03-22 20:23 WPF之家 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 数据库中的主键是char型的,数据量在1~9个的时候没有问题,可是第10个数据的位置出现问题了,在数据库中成了以下排序方法了: 1 10 2 3 4 5 6 7 8 9 很明显不符合我的要求,可是数据库中这个char型主键又不能改类型。怎么办? 在网上拔出了一个解决方法: --因为主键默认有升序聚集索引,所以在表中是按照该字段的升序排列,可以在从数据库取数据的SQL语句上改动,如:select *... 阅读全文
posted @ 2010-03-22 20:20 WPF之家 阅读(140) 评论(0) 推荐(0) 编辑