摘要: static bool CheckEnvironment() { if (Environment.Version < new Version(4, 0, 30319)) { MessageBox.Show("This version of Applicationrequires .NET 4.0. You are using: " + Environment.Version"); return false; } return true; } 阅读全文
posted @ 2013-03-27 17:56 Predator 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 非静态方法可以访问类中的任何成员,静态方法只能访问类中的静态成员。比如下面的例子:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConAttribute{ class Program { //[Obsolete("此方法已经过时了,请使用新的方法")] public static void Display() { //ShowMsg()//报错非静态的字段、方法或属性"ConAttribute.Program.ShowMsg() 阅读全文
posted @ 2013-03-27 17:41 Predator 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 用递归算法从1到9(可以重复)选出9个数相加为45,并将其打印出来不能用循环的方法using System;using System.Collections.Generic;using System.Text;using CustomLib;namespace ConTest{ class TestMain { public static void Main(string[]args) { int[] mems = new int[COUNTMEMBERS]; RegResult(mems, level); Console.Read(); } private static int COUNTM 阅读全文
posted @ 2013-03-27 15:25 Predator 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 求1 1 2 3 5 8 11 19......第n个数递归算法和循环算法的实现 private void frmMain_Load(object sender, EventArgs e) { //int result = this.FindSum(5); //MessageBox.Show(result.ToString());//输出5 // int key = 0; int result; while (true) ... 阅读全文
posted @ 2013-03-27 06:33 Predator 阅读(291) 评论(0) 推荐(0) 编辑