Easy steps to create a System Tray Application with C# z
摘要:Hiding the C# application to the system tray is quiet straight forward. With a few line of codes in C# and you can accomplish this. First you will nee...
阅读全文
posted @
2014-05-29 09:30
武胜-阿伟
阅读(466)
推荐(0) 编辑
How to Calculate difference between two dates in C# z
摘要:Do you need to find the difference in number of days, hours or even minute between the two date range?Here's how:Assuming the a and b variable is of t...
阅读全文
posted @
2014-05-29 09:26
武胜-阿伟
阅读(278)
推荐(0) 编辑
How to enable DateTimePicker to use both date and time z
摘要:Recently in one of my project I needed to have an option to display the DateTimePicker allowing user to pick both the date and the time. When I drag t...
阅读全文
posted @
2014-05-29 09:25
武胜-阿伟
阅读(234)
推荐(0) 编辑
C# Adding Hyperlink to Windows Form z
摘要:When creating a Windows form in C#, we would like to create a hyperlink so that when the user click on the link it would open up a web browser and dis...
阅读全文
posted @
2014-05-29 09:20
武胜-阿伟
阅读(394)
推荐(0) 编辑
How to easily create popup menu for DevExpress treelist z
摘要:http://www.itjungles.com/how-to-easily-create-popup-menu-for-devexpress-treelist.htmlAdding popup menu to DevExpress treelist is an easy task. Follow ...
阅读全文
posted @
2014-05-29 09:14
武胜-阿伟
阅读(683)
推荐(0) 编辑
Calling C++ code from C# z
摘要:http://blogs.msdn.com/b/borisj/archive/2006/09/28/769708.aspxI apologize for the long delay for this section (although I suppose my average posting fr...
阅读全文
posted @
2014-05-27 23:39
武胜-阿伟
阅读(372)
推荐(0) 编辑
DevExpress控件使用小结 z
摘要:1.TextEditor(barEditItem)取文本string editValue = barEditItem1.EditValue.ToString(); //错误,返回null string editValue = ((DevExpress.XtraEditors.TextEdit)...
阅读全文
posted @
2014-05-27 17:42
武胜-阿伟
阅读(23368)
推荐(1) 编辑
DevExpress 中根据数据库字典动态生成卡式菜单 z
摘要:第三方的Devexpress套件因为要使用权限机制控制不同用户进入系统显示菜单所以要配合字典数据动态生成。在WEB中这种问题灰常的轻松在winform里就稍微有点不同为了用DEV实现卡式菜单有组的概念具体如图红色部分提示:这里用了菜单头、菜单组、菜单项来逐级生成 ,首先是菜单头便利创建然后判断是否有...
阅读全文
posted @
2014-05-27 17:41
武胜-阿伟
阅读(5290)
推荐(2) 编辑
EasyHook远注简单监控示例 z
摘要:http://www.csdn 123.com/html/itweb/20130827/83559_83558_83544.htm免费开源库EasyHook(inline hook),下面是下载地址http://easyhook.codeplex.com/releases/view/24401把头文...
阅读全文
posted @
2014-05-27 11:32
武胜-阿伟
阅读(4945)
推荐(0) 编辑
dll打包进需要发布的exe z
摘要:http://www.cnblogs.com/Jarvin/p/3721195.html我们需要发布的exe文件很多时候都可能会依赖于一堆松散的dll,如果想在发布 的时候只提供exe文件,而不想把一大堆dll一起放在和exe同一个文件夹下,是有方法的,该方法由CLR via C#作者提出,我在实践...
阅读全文
posted @
2014-05-25 08:56
武胜-阿伟
阅读(5170)
推荐(0) 编辑
put a ContextMenu into the header of a TabPage z
摘要:publicclassMyTabControl:TabControl{protected override void OnMouseUp(MouseEventArgs e){if(e.Button==System.Windows.Forms.MouseButtons.Right){for(int i...
阅读全文
posted @
2014-05-24 16:06
武胜-阿伟
阅读(216)
推荐(0) 编辑
create a C# context menu from code
摘要:I try the one of your approach, it works well in my computer. Below is my code: public void AddContextMenu() { ContextMenu mnuContextMenu = new Con...
阅读全文
posted @
2014-05-24 16:02
武胜-阿伟
阅读(578)
推荐(0) 编辑
create Context Menu in Windows Forms application using C# z
摘要:In this article let us see how to create Context Menu in Windows Forms application using C#IntroductionIn this article we will see how to create Conte...
阅读全文
posted @
2014-05-24 15:58
武胜-阿伟
阅读(747)
推荐(0) 编辑
WCF开发那些需要注意的坑 Z
摘要:执行如下 批处理:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\svcutil.exe" http://127.0.0.1:40001/TestService?wsdl /language:C# /out:"D:\TestProxy.cs" /...
阅读全文
posted @
2014-05-24 15:44
武胜-阿伟
阅读(2994)
推荐(1) 编辑
The new Portable Class Library for SQLite z
摘要:Microsoft Open Technologies has recently released a Portable Class Libraryfor SQLite. Thanks to it, we can use SQLite in the same way in all the suppo...
阅读全文
posted @
2014-05-21 23:06
武胜-阿伟
阅读(520)
推荐(0) 编辑
How to cancel parallel loops in .NET C# z
摘要:Cancellation tokenParallel optionsCancellationTokenSource cancellationTokenSource = new CancellationTokenSource();Task.Factory.StartNew(() =>{ Thre...
阅读全文
posted @
2014-05-21 22:56
武胜-阿伟
阅读(238)
推荐(0) 编辑
Parallel for loops in .NET C# z
摘要:The start index: this is inclusive, i.e. this will be the first index value in the loopThe end index: this is exclusive, so it won’t be processed in t...
阅读全文
posted @
2014-05-21 22:52
武胜-阿伟
阅读(236)
推荐(0) 编辑
Parallel for-each loops in .NET C# z
摘要:An IEnumerable objectAn Action of T which is used to process each item in the listList dataList = new List { "this", "is", "random", "sentence...
阅读全文
posted @
2014-05-21 22:51
武胜-阿伟
阅读(230)
推荐(0) 编辑
Parallel stepped for loops in .NET C# z
摘要:for (int i = 0; i SteppedIntegerList(int startIndex, int endEndex, int stepSize){ for (int i = startIndex; i { Console.WriteLine...
阅读全文
posted @
2014-05-21 22:49
武胜-阿伟
阅读(173)
推荐(0) 编辑
Breaking parallel loops in .NET C# using the Stop method z
摘要:List integers = new List() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };Parallel.ForEach(integers, (int item, ParallelLoopState state) =>{ if (item > 5) { ...
阅读全文
posted @
2014-05-21 22:46
武胜-阿伟
阅读(176)
推荐(0) 编辑
AsyncEnumerableExtensions.cs z
摘要:public static class Extensions{public static async Task ForEachAsync(this IEnumerable collection, Func> body, IObserver observer = null){foreach (var ...
阅读全文
posted @
2014-05-19 18:15
武胜-阿伟
阅读(414)
推荐(0) 编辑
Algorithm for Maximum Subsequence Sum z
摘要:MSS(Array[],N)//Where N is the number of elements in array{sum=0; //current summax-sum=0;//Maximum Sumseq-start=0;//start of the subsequenceseq-end=0;...
阅读全文
posted @
2014-05-19 18:05
武胜-阿伟
阅读(164)
推荐(0) 编辑
Loader for loading embedded assemblies z
摘要:using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Reflection;using System.Runtime.InteropServices;namespace...
阅读全文
posted @
2014-05-19 18:01
武胜-阿伟
阅读(285)
推荐(0) 编辑
SQLite Helper (C#) zt
摘要:http://www.codeproject.com/Articles/746191/SQLite-Helper-CsharpThis small class (SQLiteHelper.cs) is built on top of System.Data.SQLite.DLL. A referen...
阅读全文
posted @
2014-05-19 17:48
武胜-阿伟
阅读(1083)
推荐(0) 编辑
转换时间为 “XX分钟之前”
摘要:public static string getTimeAgo(string strDate) { string strTime = string.Empty; if (clsCommon.IsDate(strDate)) { T...
阅读全文
posted @
2014-05-19 17:36
武胜-阿伟
阅读(276)
推荐(0) 编辑
OD使用经验【转载】
摘要:文章整理发布:黑客风云1.我的os是winXP,无法使用trw2000,而softice装了多次均未成功,还蓝屏死机多次.郁闷.2.友好的gui界面,不像softice.可以边干活边听歌,不像softice,把整个os都挂起了.多用两次,连时间都不知道了.3.强大的内存查看功能,再不用什么-d了,而...
阅读全文
posted @
2014-05-18 20:43
武胜-阿伟
阅读(1724)
推荐(0) 编辑
ollydbg z
摘要:通达信l2密码器方法: 1:使用Ollydbg,点文件,打开,选择通达信的可执行文件(或者把通达信的执行文件直接拖进Ollydbg的窗口),按F9运行程序。 2:正常使用通达信,进入到K线图后,在k线图(主图或者副图上)点右键,选择指标,然后选择一个加密的公式,点确定。此时公式应该能正确使用并且在...
阅读全文
posted @
2014-05-18 20:42
武胜-阿伟
阅读(1075)
推荐(0) 编辑
C# using SendMessage, problem with WM_COPYDATA z
摘要:The final missing piece depends on if you are using any processor, x86 or x64. The details using these different functions requires specific handling ...
阅读全文
posted @
2014-05-18 09:20
武胜-阿伟
阅读(1200)
推荐(0) 编辑
进程通信之一 使用WM_COPYDATA C++及C#实现 z
摘要:原文地址:http://blog.csdn.net/morewindows/article/details/6804157进程间通信最简单的方式就是发送WM_COPYDATA消息。本文提供C++及C#程序相互通信的二种实现方式。这样消息的接收端可以用C++实现,发送端可以用C++或C#实现。发送WM...
阅读全文
posted @
2014-05-17 23:27
武胜-阿伟
阅读(3253)
推荐(0) 编辑
tdx api z
摘要:调用TdxAPI.dll函数.DLL命令 TdxInit, 逻辑型, "TdxApi.dll", "TdxInit", , 初始化通达信实例,成功时返回true,失败时返回false .参数 IP, 文本型, , 交易服务器IP .参数 Port, 整数型, , 交易服务器端口 .参数 Versio...
阅读全文
posted @
2014-05-17 23:17
武胜-阿伟
阅读(4862)
推荐(1) 编辑
ExpectationMaximum
摘要:2- You may have question marks in your head, especially regarding where the probabilities in the Expectation step come from. Please have a look at the...
阅读全文
posted @
2014-05-16 11:38
武胜-阿伟
阅读(809)
推荐(0) 编辑
那些跟钱有关的事儿 z
摘要:这是两段朴实的创业笔记,作者是王信文,2009年南京大学本科毕业,2009年9月到2013年3月在腾讯上海的互动娱乐部门工作,2013年3月到现在和几个前同事一起创立了莉莉丝游戏(手游刀塔传奇是他们后来的创业作品)。偶然间看到了他2013年刚创业时写的两篇创业笔记,于是摘选整合了一下,发出来,大家一...
阅读全文
posted @
2014-05-16 08:20
武胜-阿伟
阅读(284)
推荐(0) 编辑
How to Convert a Date Time to “X minutes ago” in C# z
摘要:http://www.codeproject.com/Articles/770323/How-to-Convert-a-Date-Time-to-X-minutes-ago-in-CshIn one of our previous posts, we saw how can we convert a...
阅读全文
posted @
2014-05-13 08:27
武胜-阿伟
阅读(308)
推荐(0) 编辑
MemoryMappedFile 内存映射文件 msdn
摘要:http://msdn.microsoft.com/zh-cn/library/dd997372%28v=vs.110%29.aspx内存映射文件 .NET Framework 4.5 其他版本 1(共 1)对本文的评价是有帮助 - 评价此主题 内存映射文件包含虚拟内存中文件的内容。 利用文件...
阅读全文
posted @
2014-05-11 09:34
武胜-阿伟
阅读(6108)
推荐(1) 编辑
让泛型类支持数值计算
摘要:class Ref{ public T Value; public Ref() { } public Ref(T value) { this.Value = value; }}Then use it like this:class A{ ...
阅读全文
posted @
2014-05-08 08:32
武胜-阿伟
阅读(583)
推荐(0) 编辑
Initializing nested object properties z
摘要:public class Employee{ public Employee() { this.Insurance = new Insurance(); } // Perhaps another constructor for the name? pub...
阅读全文
posted @
2014-05-08 08:25
武胜-阿伟
阅读(207)
推荐(0) 编辑
C# Multilanguage messagebox z
摘要:Either way, can't you just call MessageBox.Show(rm.GetString("messageboxData", ci))class MyClass{ CultureInfo currentCultureInfo; public MyClass...
阅读全文
posted @
2014-05-08 08:18
武胜-阿伟
阅读(686)
推荐(0) 编辑
用C#调用Windows API向指定窗口发送按键消息 z
摘要:用C#调用Windows API向指定窗口发送 一、调用Windows API。 C#下调用Windows API方法如下: 1、引入命名空间:usingSystem.Runtime.InteropServices; 2、引用需要使用的方法,格式:[DllImport("DLL文件")]方法的声明;...
阅读全文
posted @
2014-05-07 09:16
武胜-阿伟
阅读(19128)
推荐(4) 编辑
通达信自动交易软件 z
摘要:1、要善用spy++2、不同的控件主要靠GetDlgCtrlID去区分3、要获得另一个进程的焦点窗口(GetFocus)需要调用AttachThreadInput4、尽量少用keybd_event模拟键盘输入,主要是该函数不能保证按键消息一定能被特定进程接收到。取而代之的是SendMessage(h...
阅读全文
posted @
2014-05-07 08:56
武胜-阿伟
阅读(20559)
推荐(0) 编辑
keybd_event跟SendMessage,PostMessage模拟键盘消息的区别 z
摘要:首先你会发现keybd_event函数中是没有窗口句柄作为参数的,好奇的你一定会觉得很奇怪,那是因为,keybd_event是全局模拟按键的,只对前台窗口(即当前的活动窗口)才可以,但是如果模拟的按键正好也是某个窗口的全局热键消息,那该窗口也能接收到的 而SendMessage 、PostMessa...
阅读全文
posted @
2014-05-07 08:55
武胜-阿伟
阅读(7443)
推荐(0) 编辑
55人班37人进清华北大的金牌教师之32条教育建言! z
摘要:他带的一个55人的班,37人考进清华、北大,10人进入剑桥大学、耶鲁大学、牛津大学等世界名校并获全额奖学金,其他考入复旦、南开等大学。不仅 如此,校足球冠军、校运动会总冠军、校网页设计大赛总冠军等6项文体冠军,都被这个班夺走;音乐才子、辩论高手、电脑奇才、跆拳道高手在这个班比比皆是。 他也是一名相当...
阅读全文
posted @
2014-05-05 08:40
武胜-阿伟
阅读(389)
推荐(0) 编辑
SafeHandle和Dispose z
摘要:SafeHandle最大的意义是封装一个托管资源且本身会执行.NET中的资源释放模式(所谓的Dispose Pattern),这样,开发者在使用非托管资源时,不可以不需要执行繁琐的资源释放模式,而直接使用SafeHandle就可以了,另外SafeHandle继承自CriticalFinalizerO...
阅读全文
posted @
2014-05-04 22:32
武胜-阿伟
阅读(2249)
推荐(0) 编辑
Path类型的扩展方法 z
摘要:写了一个基于System.IO.Path类型方法的扩展类型,用于快速对文件系统路径进行操作。如下图:其中有许多方法就是直接调用Path类型的静态方法。比如AppendPath方法内部会直接调用Path.Combine。这些方法就不需要再介绍了。下面看一些许多说明的方法:ToDirectory方法会把...
阅读全文
posted @
2014-05-04 22:31
武胜-阿伟
阅读(519)
推荐(0) 编辑
BinaryReader和BinaryWriter的leaveOpen参数 z
摘要:在.NET 4.5后,微软为BinaryWriter和BinaryReader类型的构造函数中加入了leaveOpen参数,当该参数为true后,BinaryReader或者BinaryWriter关闭后不会关闭其内部的Stream对象。但是在.NET 4.5之前,怎样在BinaryWriter或者...
阅读全文
posted @
2014-05-04 22:26
武胜-阿伟
阅读(1054)
推荐(0) 编辑
任务栏窗口和状态图标的闪动 z
摘要:Demo程序:实现任务栏窗体和图标的闪动:整个程序是基于Windows Forms的,对于任务栏右下角状态图标的闪动,创建了一个类型:NotifyIconAnimator,基本上是包装了Windows Forms中的NotifyIcon类型,然后内部有个Timer,不断循环设置NotifyIcon的...
阅读全文
posted @
2014-05-04 22:22
武胜-阿伟
阅读(5980)
推荐(0) 编辑
位操作:BitVector32结构 z
摘要:目录温习位操作BitVector32的位操作CreateMask方法 使用BitVector32.Section来存储小整数BitVector32结构体位于System.Collections.Specialized命名空间内,相对.NET中另外一个位容器BitArray,他的优点是速度快,占用空间...
阅读全文
posted @
2014-05-04 22:02
武胜-阿伟
阅读(1728)
推荐(0) 编辑
明修栈道,暗渡陈仓----之私募一哥徐翔新玩法 z
摘要:前言:去年以来,因徐翔和宁电突然举牌资质平平的 000692 惠天热电,引起本人的兴趣,陆陆续续花了比较多的时间和精力去研究和跟踪000692惠天热电,期间也两次亲自去沈阳调研,从一些台前幕后人士那里,逐步 对私募一哥徐翔有了更深入的了解,因为徐翔一贯给人的印象是低调,甚至是超低调,但自从那个录音门...
阅读全文
posted @
2014-05-03 09:08
武胜-阿伟
阅读(694)
推荐(0) 编辑
研究一家公司 z
摘要:第一部分:确定一家公司的“质地”(描绘一家公司的总体印象)1.1 天花板天花板是指企业或行业的产品(或服务)趋于饱和、达到或接近供大于求的状态。在进行投资之前,我们必须明确企业属于下列哪一种情况,并针对不同情况给出相应的投资策略。在判断上,既要重视行业前景,也必须关注企业素质。1)已经达到天花板的行...
阅读全文
posted @
2014-05-03 09:06
武胜-阿伟
阅读(391)
推荐(0) 编辑
不要浪费人生的每一天 ——Dropbox创始人在麻省理工的演讲 z
摘要:Dropbox 创始人,CEO 德鲁·休斯顿(Drew Houston)近期在美国麻省理工学院的毕业典礼上发表演讲。他向大学生提出了 3 点人生建议:追逐自己感兴趣的事,找到最合适的圈子,以及不要浪费人生的每一天。以下为休斯顿演讲全文: 谢谢董事会主席里德,也祝贺所有 2013 届毕业的同学。我很...
阅读全文
posted @
2014-05-03 07:54
武胜-阿伟
阅读(468)
推荐(0) 编辑