2011年12月4日

WPF摘抄

摘要: 简单的布局有CanvasStartPoint和EndPoint表示渐变线的起点和终点,控件的左上角点的坐标为(0,0)右下角点的坐标为(1,1)。前面的数字表示水平。使用GradientStop的Offset,可以定义多个渐变点(Offset的值在0和1之间),-----------------------------------------------4.0 Framework 引用 2.0 的Sqlite,需要在根目录新建app.config文件,里面CODE如下:<?xml version="1.0"?><configuration><s 阅读全文

posted @ 2011-12-04 22:23 breakpoint 阅读(282) 评论(0) 推荐(0) 编辑

2011年11月19日

在.NET C#中使用sqlite

摘要: 1。从www.sqlite.org下载SQLite 3.3.4的版本 为了方便,我把它解压了,就一个SQLite3.exe,放入Windows目录下。 Cmd 进入命令行 1) 创建数据库文件: >SQLite3 d:\test.db 回车 就生成了一个test.db在d盘。 这样同时也SQLite3挂上了这个test.db 2) 用.help可以看看有什么命令 >.help 回车即可 3)可以在这里直接输入SQL语句创建表格 用;结束,然后回车就可以看到了 4)看看有创建了多少表 >.tables 5)看表结构 >.schema 表名 6)看看目前挂的数据库 > 阅读全文

posted @ 2011-11-19 22:08 breakpoint 阅读(430) 评论(0) 推荐(0) 编辑

2011年11月17日

Blend学习网站

摘要: http://www.silverlightchina.net/html/download/WPFResource/http://www.silverlightchina.net/html/study/WPF/http://www.silverlightchina.net/html/zhuantixilie/getstart/2011/0306/5860.htmlhttp://www.cnblogs.com/kaodigua/category/283287.html 阅读全文

posted @ 2011-11-17 22:44 breakpoint 阅读(120) 评论(0) 推荐(0) 编辑

2011年11月15日

EventExample1

摘要: using System;namespace EventExample1{ public delegate void ChangedEventHandler(object sender, EventArgs e); public class MyText { public event ChangedEventHandler Changed; protected virtual void OnChanged() { if (Changed != null) { Changed(this, null); } } private string _text = string.Empty; public 阅读全文

posted @ 2011-11-15 22:43 breakpoint 阅读(114) 评论(0) 推荐(0) 编辑

EventEmail

摘要: using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;namespace EventEmail{ public class MailData { public readonly string from, to, subject, body; public MailData(string from, string to, string subject, string body) { this.from = from; this.to = to; this.subject 阅读全文

posted @ 2011-11-15 22:43 breakpoint 阅读(154) 评论(0) 推荐(0) 编辑

OperationDelegate

摘要: using System;namespace DelegateSample1{ //define delegate public delegate int OperationDelegate(int x, int y); class Operator { private int _x, _y; static void Main(string[] args) { OperationDelegate del = null; del += new OperationDelegate(Plus); del += new OperationDelegate(Subtract); Operator op 阅读全文

posted @ 2011-11-15 22:40 breakpoint 阅读(117) 评论(0) 推荐(0) 编辑

WinLogs

摘要: using System.Diagnostics;using System;namespace ConsoleApplication1{ class WinLogs { private static void Main44() { EventLog log = new EventLog("MyEvent"); //System 默认是Application // 首先应判断日志来源是否存在,一个日志来源只能同时与一个事件绑定 if (!EventLog.SourceExists("MyApplicationCCC")) //向非Application事件 阅读全文

posted @ 2011-11-15 22:38 breakpoint 阅读(142) 评论(0) 推荐(0) 编辑

Yield

摘要: //Copyright (C) Microsoft Corporation. All rights reserved.using System;using System.Collections.Generic;using System.Text;namespace Yield{ class Yield { public static class NumberList { // Create an array of integers. public static int[] ints = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 }; 阅读全文

posted @ 2011-11-15 22:36 breakpoint 阅读(195) 评论(0) 推荐(0) 编辑

TestWhere

摘要: using System;using System.Collections;using System.Collections.Generic;using System.Linq;namespace ConsoleApplication1{ //在定义泛型类时,可以对客户端代码能够在实例化类时用于类型参数的类型种类施加限制。如果客户端代码尝试使用某个约束所不允许的类型来实例化类,则会产生编译时错误。这些限制称为约束。约束是使用 where 上下文关键字指定的。 // 从 Visual C# 3.0 开始,在方法范围中声明的变量可以具有隐式类型 var。 隐式类型的本地变量是强类型变量(就好像您已 阅读全文

posted @ 2011-11-15 22:35 breakpoint 阅读(109) 评论(0) 推荐(0) 编辑

ThreadClass

摘要: using System;using System.Threading;using System.Linq;using System.Collections.Generic;namespace ThreadingTester{ /*“Lambda 表达式”是一个匿名函数,它可以包含表达式和语句,并且可用于创建委托或表达式目录树类型。 所有 Lambda 表达式都使用 Lambda 运算符 =>,该运算符读为“goes to”。该 Lambda 运算符的左边是输入参数(如果有),右边包含表达式或语句块。 => 标记称作 lambda 运算符。该标记在 lambda 表达式中用来将左侧 阅读全文

posted @ 2011-11-15 22:35 breakpoint 阅读(213) 评论(0) 推荐(0) 编辑

导航