摘要: public decimal GetStringLastNumber(string str) { decimal result = 0; if (str != null && str != string.Empty) { Match match = Regex.Match(str, @"(^.+?)(\d+$)"); if(match.Success) { result = decimal.Parse(match.Groups[2].Value); } } return result; } 阅读全文
posted @ 2012-11-15 15:47 therockthe 阅读(969) 评论(0) 推荐(0) 编辑
摘要: Actionaction=newAction(()=>{Thread.Sleep(5000);});varAsync=Observable.FromAsyncPattern(action.BeginInvoke,action.EndInvoke);Observable.Timeout(Async.Invoke(),DateTimeOffset.Now.AddSeconds(3)).ObserveOnDispatcher().Subscribe(it=>{MessageBox.Show("执行完毕");},ex=>{MessageBox.Show(" 阅读全文
posted @ 2012-07-10 15:49 therockthe 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 如果要转载请注明来出处(http://www.cnblogs.com/therock),谢谢!描述:可以对按钮的选择或未选择时的文字颜色以及背景图片进行变换。效果如下:首先是自定义按钮类:View Code publicclassTextImageButton:Button{publicTextImageButton(){this.IsSelectedChanged+=newIsSelectedChangedEventHandler(TextImageButton_IsSelectedChanged);}privatevoidTextImageButton_IsSelectedChanged( 阅读全文
posted @ 2012-05-14 16:08 therockthe 阅读(3949) 评论(1) 推荐(0) 编辑
摘要: 通过调用Windows API中的GetLastInputInfo来获取最后一次输入的时间usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;usingSystem.Windows.Documents;usingSystem.Windows.Input;usingSystem.Windows.Media;usingSystem.Windows.M 阅读全文
posted @ 2012-02-12 18:15 therockthe 阅读(1902) 评论(2) 推荐(3) 编辑
摘要: 一般在创建WCF服务时会用Serivce.svc文件访问,地址如:http://localhost/applicationname/Serivce.svc/Name现在用路由映射成:http://localhost/applicationname/MyService/Name 方法如下:首先在Global.asax中的Application_Start事件中添加以下代码: void Application_Start(object sender, EventArgs e) { System.Web.Routing.RouteTable.Routes.Add(new System.Servic. 阅读全文
posted @ 2011-12-04 10:27 therockthe 阅读(2288) 评论(1) 推荐(1) 编辑
摘要: VirtualBox安装Mac OS首先要用empireEFIv1085.iso引导盘启动时,要注意把VirtualBox里虚拟机系统里的EFI选项去掉才能正常启动: 阅读全文
posted @ 2011-09-18 03:25 therockthe 阅读(1091) 评论(0) 推荐(0) 编辑
摘要: create function [dbo].[RemoveStr](@InputStr varchar(50)) returns varchar(50)ASBEGINdeclare @BackStr varchar(50)if patindex('%[^0]%',@InputStr) <> 1beginset @BackStr = substring(@InputStr,patinde... 阅读全文
posted @ 2010-05-24 17:50 therockthe 阅读(1189) 评论(0) 推荐(0) 编辑
摘要: 今天是6月27日星期五,一周中最后一天的工作日,对于我们大多数人来说,将会是很平凡的一天,但对于有一个人来说,今天将他是一生中最不平凡的一天,因为过完今天这个星期五,从下周起,他将放弃掉一份他最心爱的、并影响了世界很多人的工作,去做另一份更伟大的、并也会影响世界很多人的工作,这份工作就是慈善基金会的工作,这个人就是Bill Gates 。在三十多年前,他怀着让每一个人的桌子上都拥有一台电脑的梦想并... 阅读全文
posted @ 2008-06-27 08:29 therockthe 阅读(2920) 评论(47) 推荐(0) 编辑
摘要: 前天(9月3日),一大早就勿勿的赶去参加了广州.net俱乐部第一次聚会活动,地点虽有点远(设在小新塘那边的广州软件产业基地),但到时还是比其它人来得早,因为其它人住得可能离这边更远。 由于活动联系到了软件园里的会议室,所以会议室的设施和环境非常的好。第一次见到ocean(广州.net俱乐部负责人),觉得他人挺不错的,为了这次活动忙碌了很多,目的就是为了让更多的.net爱好者或广州.net阵营的人... 阅读全文
posted @ 2005-09-05 16:45 therockthe 阅读(485) 评论(1) 推荐(1) 编辑
摘要: Net中实际上已经为我们在这方面做得很好了。FCL中提供了不少的类来帮助我们完成这项工作,让我们的开发工作变非常简单和快乐。编程控制IIS实际上很简单,和ASP一样,.Net中需要使用ADSI来操作IIS,但是此时我们不再需要GetObject这个东东了,因为.Net为我们提供了更加强大功能的新东东。 System.DirectoryServices命名空间中包括了些强大的东东--Director... 阅读全文
posted @ 2005-07-27 17:44 therockthe 阅读(514) 评论(0) 推荐(0) 编辑