码迷,mamicode.com
首页 > Windows程序
c# 单例模式(Single)
public class Singleton { private static Singleton _instance; private static readonly object syn = new object(); private Singl...
分类:Windows程序   时间:2014-11-29 00:08:16    阅读次数:223
C# 使用Dictionary、linq实现根据集合里面的字符串进行分组
分组两种方法:List list = new List() { "1_32", "2_10", "1_8", "1_25", "2_3", "3_5", "5_15", "3_16" }; //对上面集合里面的字符串按照“_”进行分组。 ...
分类:Windows程序   时间:2014-11-29 00:07:09    阅读次数:152
使用SALT-API进入集成开发的简单样例
测试的时候,可以CURL -K,但真正作集成的时候,却是不可以的。必须,不可以让TOKEN满天飞吧。现在进入这个阶段了。写个样例先:import saltimport salt.authimport salt.logimport saltapiopts = salt.client.LocalClie...
分类:Windows程序   时间:2014-11-29 00:05:30    阅读次数:401
WinForm窗体屏幕边缘停靠
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms...
分类:Windows程序   时间:2014-11-29 00:06:58    阅读次数:300
【WPF学习笔记三】空WPF项目元素详解
我们在VisualStudio2010创建了一个空WPF程序,现在我们来对这个空WPF程序的所有元素进行讲解!1.5. 6. 7.xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x=http://sche....
分类:Windows程序   时间:2014-11-28 22:46:11    阅读次数:477
WPF性能提升的十个技巧
【IT168专稿】WPF(Windows Presentation Foundation)应用程序在没有图形加速设备的机器上运行速度很慢是个公开的秘密,给用户的感觉是它太吃资源了,WPF程序的性能和硬件确实有很大的关系,越高档的机器性能越有优势。 程序性能改善不是一蹴而就的,好的设计可以消除影响性....
分类:Windows程序   时间:2014-11-28 22:44:03    阅读次数:565
WPF实现Winform的DoEvent事件
WPF实现Winform的DoEvent事件 1 C#中的DoEvent事件可以实现消息处理的一些特殊操作,可以做出延迟响应的事件。 2 C# code如下: 3 4 int tick=Environment.TickCount; 5 while (En...
分类:Windows程序   时间:2014-11-28 22:36:58    阅读次数:1799
c#面试题及答案(二)
2 .列举ASP.NET 页面之间传递值的几种方式。答. 1).使用QueryString, 如....?id=1; response. Redirect().... 2).使用Session变量 3).使用Server.Transfer3. 一列数的规则如下: 1、1、2、3、5、8、13、21、...
分类:Windows程序   时间:2014-11-28 21:26:02    阅读次数:407
windows编程一些小知识
1.Unicode字符。 以一个内建的数据类型wchar_t,以其来表示16位的Unicode(UTF-16)字符。 eg:wchar_t c=L'A'; 在WinNT.h中定义有: typedef char CHAR;//An 8-bit character typedef wchar_t ...
分类:Windows程序   时间:2014-11-28 21:22:47    阅读次数:245
c#获取url中的查询字符串参数
/// /// 获取url中的查询字符串参数 /// public static NameValueCollection ExtractQueryParams(string url) { int sta...
分类:Windows程序   时间:2014-11-28 20:09:54    阅读次数:441
C#可空类型 T?
可空类型概述可空类型具有以下特性:可空类型表示可被赋值为null值的值类型变量。无法创建基于引用类型的可空类型。(引用类型已支持null值。)。语法T?是 System.Nullable 的简写,此处的T为值类型。这两种形式可以互换。为可空类型赋值与为一般值类型赋值的方法相同,如int? x = 1...
分类:Windows程序   时间:2014-11-28 20:06:36    阅读次数:333
c#对象初始化
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace nange_1{ class A { public int a=1;//这里和c++不一样...
分类:Windows程序   时间:2014-11-28 20:06:43    阅读次数:271
【C# 语法糖】
【C# 语法糖】一, 扩展方法 1. 对某个类功能上的扩展 2. 特点: 使用方便,可以在不修改原代码的基础上进行扩展。 参照 linq,linq 就是一系列的扩展方法 3. 语法: 非泛型静态类,静态方法, 第一个参数加 this,表示是对该类型的扩展 4. 代码 public s...
分类:Windows程序   时间:2014-11-28 20:04:00    阅读次数:243
WPF StoreDataSetPaginator
public class StoreDataSetPaginator : DocumentPaginator { private DataTable dt; // Could be wrapped with public properties that call P...
分类:Windows程序   时间:2014-11-28 20:04:18    阅读次数:314
Day9--------windowDrag
//-----------使用嵌套的事件完成窗口的拖拉效果 1 2 3 4 5 6 7 11 34 35 36 37
分类:Windows程序   时间:2014-11-28 20:04:15    阅读次数:283
C#文件操作
通常来讲,用C#程序读写一个文件需要以下5个步骤。 创建文件流。 创建阅读器或写入器。 执行读写操作。 关闭阅读器或写入器。 关闭文件流。 在进行文件操作时候,需要在类中引用 System.IO命名空间。 创建文件流: 流是一个用于数据传输的对象,这里使用的文件流失FileStream类。 File...
分类:Windows程序   时间:2014-11-28 20:03:17    阅读次数:219
WinForm窗体间如何传值
窗体间传递数据,无论是父窗体操作子窗体,还是子窗体操作符窗体,有以下几种方式: 公共静态变量; 使用共有属性; 使用委托与事件; 通过构造函数把主窗体传递到从窗体中; 一、通过静态变量 特点:传值是双向的,实现简单 实现代码如下: 在一个app类中定义一个静态成员value public class...
分类:Windows程序   时间:2014-11-28 19:59:35    阅读次数:312
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!