C#
文章平均质量分 55
zx917
这个作者很懒,什么都没留下…
展开
-
string and byte[] converter
byte[] byteArray = System.Text.Encoding.Default.GetBytes ( str ); string str = System.Text.Encoding.Default.GetString ( byteArray ); public static string ToHexString ( byte[] bytes ) //原创 2012-08-01 11:43:07 · 470 阅读 · 0 评论 -
c# 线程
名称空间:System.Threading 异步委托 异步委托使用线程池。基于IAsyncResult的异步模式。 static int TakesAWhile(int data, int ms) { } public delegate int TakesAWhileDelegate(int data, int ms); static void Main() TakesAWhil原创 2012-11-07 10:13:47 · 761 阅读 · 0 评论 -
c# Runtime load library; Load Assembly from Specific Directory Path
Reference: http://www.chilkatsoft.com/p/p_502.asp using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using Sy转载 2012-10-18 13:06:57 · 703 阅读 · 0 评论 -
C# using
http://www.cnblogs.com/cding/articles/1363712.html 1.using指令。using + 命名空间名字 2.using别名。using + 别名 = 包括详细命名空间信息的具体的类型。 3.using语句,定义一个范围,在范围结束时处理对象。 场景: 当在某个代码段中使用了类的实例,而希望无论因为什么原因,只要离开了这个代码段就自转载 2012-09-06 11:01:05 · 269 阅读 · 0 评论 -
委托-异步调用-泛型委托-匿名方法-Lambda表达式-事件
1. 委托 From: http://www.cnblogs.com/daxnet/archive/2008/11/08/1687014.html 类是对象的抽象,而委托则可以看成是函数的抽象。一个委托代表了具有相同参数列表和返回值的所有函数。 class Program { delegate int CalculateDelegate(int a,转载 2012-08-28 17:31:10 · 3476 阅读 · 0 评论 -
P/Invoke
http://blog.csdn.net/qixi0616/article/details/2865498 平台调用是一种服务,它使托管代码能够调用 DLL 中实现的非托管函数. 如调用系统的 API 或与 COM 对象打交道,通过 System.Runtime.InteropServices 命名空间. 例如: MessageBox在win32的头文件中的声明: int转载 2012-08-28 13:48:15 · 515 阅读 · 0 评论 -
Control的Invoke和BeginInvoke
Reference: http://www.cnblogs.com/c2303191/articles/826571.html MethodInvoker 提供一个简单委托,该委托用于调用含 void 参数列表的方法。在对控件的 Invoke 方法进行调用时或需要一个简单委托又不想自己定义时可以使用该委托(摘自MSDN) 在多线程编程时,DotNet2.0会对跨线程访问控件进转载 2012-09-06 10:53:57 · 442 阅读 · 0 评论 -
Get current time and interval
Reference: http://blog.sina.com.cn/s/blog_7e2ace6a0100xqk5.html C++ DWORD GetTickCount(); GetLocalTime(SYSTEMTIME*); char buffer[1024]; SYSTEMTIME s; GetLocalTime(&s);转载 2012-08-27 15:20:09 · 473 阅读 · 0 评论 -
timer
Reference: http://www.cnblogs.com/ryhan/archive/2011/07/14/2106350.html http://www.biye5u.com/article/Csharp/winform/2010/2813.html 在C#里现在有3个Timer类: System.Windows.Forms.Timer System.Threadin转载 2012-09-04 11:19:36 · 329 阅读 · 0 评论 -
C#Hashtable与Dictionary性能
http://www.cnblogs.com/zcy_soft/archive/2010/10/02/1841165.html转载 2012-09-03 16:56:03 · 325 阅读 · 0 评论 -
Find the Root Folder Name of the SD Card.
Find the Root Folder Name of the SD Card. void getSdCardPath() { DirectoryInfo rootDir = new DirectoryInfo(@"\"); FileAttributes attrStorageCard = FileAttributes.Directory | FileAttributes.Tem转载 2012-08-01 16:30:09 · 372 阅读 · 0 评论 -
从C#程序中调用非受管DLLs
using System.Runtime.InteropServices; // DllImport所在的名字空间 [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_POWER_STATUS { public byte ACLine原创 2012-08-29 10:52:29 · 522 阅读 · 0 评论