上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 49 下一页
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace _2计算器练习{ public partial class Form1 : Form { public Form1() { InitializeComponent()... 阅读全文
posted @ 2012-02-27 23:19 简单--生活 阅读(204) 评论(0) 推荐(0) 编辑
摘要: jQuery提供簡單易用的DOM操作能力,讓我們可以專注於Javascript程式的邏輯而不用去理會煩人的DOM操作、瀏覽器相容等問題。我們可以利用next()來取得同級的下一個元素,利用prev()來取得同級的上一個元素,但是jQuery並無直接由函數提供取得同級的第一個元素、同級的最後一個元素、同級的任一元素,因此我們可以利用jQuery強大的Selector(選擇器)達成這樣的需求,並替jQuery擴充功能。擴充jQuery的功能函數,把以下程式碼加入JQuery中view plaincopy to clipboardprint?//取得第一個同級元素$.fn.first=functio 阅读全文
posted @ 2012-02-27 12:00 简单--生活 阅读(1510) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using _16命名空间.hr;using System.Collections; //如果要使用的类和当前的类不在同一个namespace中,则需要using引用的//using _Person;/* 命名空间 * namespace(命名空间),用于解决类重名问题,可以看做是"类的文件夹" * 在代码中使用其他类的时候需要using类所在的namespace. System.Collections.Arra 阅读全文
posted @ 2012-02-26 13:35 简单--生活 阅读(224) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;/* 常量与静态成员 * const常量,常量名要大写 * 不用new就能用的方法: static方法,static方法其实就是普通的函数 * 在static方法中可以调用其他static方法,字段,属性,但不能调用非static方法,字段,属性,在非static方法可可以调用static的方法,字段 * * */namespace _14常量{ class Program { public const ... 阅读全文
posted @ 2012-02-26 11:13 简单--生活 阅读(206) 评论(0) 推荐(0) 编辑
摘要: using System;/* 异常异常处理 * 传统的错误表达方式: 错误码,举列 * 错误码的缺点:不处理的则很难发现,每次处理则很麻烦,难以看出错误的原因,容易使得程序进入不确定的状态 * try catch Exception ex异常也是对像 * Exception类主要属性: Message, StackTrace * 发生异常后程序默认就退出了,后续代码不会被执行了,catch以后的代码则会继承执行 * 不要吃掉异常 * 扔出自己的异常 * */namespace _12异常{ class Program { static void Main(strin... 阅读全文
posted @ 2012-02-25 09:04 简单--生活 阅读(162) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;/* 定义类的时候不指定父类,则父类是Object类,Object类是任何类的直接或者间接父类 * */namespace _10继承{ class Program { static void Main(string[] args) { China c = new China(); c.Age = 22; c.Name = "向... 阅读全文
posted @ 2012-02-25 00:36 简单--生活 阅读(143) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace _9对像的引用2{ class Program { static void Main(string[] args) { int i = 10; int j = i; //拷贝 i++; Console.WriteLine(j); //int, datetime,bo... 阅读全文
posted @ 2012-02-25 00:21 简单--生活 阅读(174) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;/* 构造函数 * 构造函数是用来创建对像的特殊函数,函数名和类名一样,没有返回值,连void都不用 * 构造函数可以有参数,new对像的时候传递函数参数即可 * 构造函数可以重载,也就是有我个参数不同的构造函数 * 如果不指定构造函数,则类有一个默认的无参构造函数 * 如果指定了构造函数,则不再有默认的无参构造函数,如果需要无参构造函数,则需要自己来写 */namespace _8构造函数{ class Program ... 阅读全文
posted @ 2012-02-25 00:12 简单--生活 阅读(194) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;//Red Gate's Reflector 反编译工具namespace _5属性2{ class Program { static void Main(string[] args) { //Person5 p = new Person5(); //p.Age = 30; //Console.WriteLine(p.Age);... 阅读全文
posted @ 2012-02-23 23:53 简单--生活 阅读(181) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;/* 面向对像版聊天机器人 * 机器人有不同的名字,维护自己的FullLevel,可以SayHello,可以喂食,可以对它说话(Speak),对异常情况(错误的喂饭数字,喂养的太多撑死了)进行处理,有两个机器人供选择,一开始通过1 2 数字选择聊天机器人 * * */namespace _4练习聊天机器人{ class Program { static void Main(string[] args) ... 阅读全文
posted @ 2012-02-23 23:35 简单--生活 阅读(436) 评论(0) 推荐(0) 编辑
上一页 1 ··· 38 39 40 41 42 43 44 45 46 ··· 49 下一页
简单--生活(CSDN)