易截截图软件、单文件、免安装、纯绿色、仅160KB

C#预处理器指令入门

一、C#预处理器指令入门 #define NET11  //NET11,NET20,(必须放在文件第一行)
using System;
//… …
//… …
//… …

string sBeepType = s.Replace(sKey,"");
#if NET20
int.TryParse(sBeepType,out beepType); //在.net 2.0中才有的方法
#endif
#if NET11
try
{
    beepType=int.Parse(sBeepType);
}
catch{}
#endif 二、抄自MSDN(http://msdn.microsoft.com/zh-cn/library/ed8yd1ha(VS.80).aspx) #if
#else
#elif
#endif

# define
#undef

#warning
#error

#line
    #line 行号
    #line hidden
    #line default
    #line filename

#region
#endregion

#pragma
#pragma warning
#pragma checksum


相关文档:

c# enmu 枚举小结(1)

 
枚举
  枚举类型声明为一组相关的符号常数定义了一个类型名称。枚举用于“多项选择”场合,就是程序运行时从编译时已经设定的固定数目的“选择”中做出决定。
  枚举类型(也称为枚举)为定义一组可以赋给变量的命名整数常量提供了一种有效的方法。例如,假设您必须定义一个变量,该变量 ......

利用WM_COPYDATA在应用程序间传递数据(C#)

利用WM_COPYDATA在应用程序间传递数据很简单,开销也小
一、传递数据部分
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace ThreeTorches
{
    public struct Copydatastru ......

c# 类库

[SerializableAttribute]
[ComVisibleAttribute(true)]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDual)]
public class Object
1 public virtual bool Equels (Object)
2 public static bool static Equels (Object,Object)
默认实现为对引用类型使用引用相等,对值类型使用二进制按位相等。引用相等性是指进 ......

C#实现文件关联

和其他语言一样,C#实现文件关联同样需要直接操作注册表,即按规则分别设置文件扩展名,文档类型说明,友好名称,图标,调用方法等键值即可,网上随便查查就可以写出以下的代码。 using Microsoft.Win32; RegistryKey key = Registry.ClassesRoot.OpenSubKey(".jb");
if (key == null)
{
 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号