05 2015 档案
摘要:服务器端using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Ne...
阅读全文
摘要:using System;using System.Drawing;using System.Windows.Forms;using System.Threading;namespace WindowsFormsApplication1{ public partial class Form1 ...
阅读全文
摘要:private void Form1_Load(object sender, EventArgs e) { //取消跨线层访问控件的判断 Control.CheckForIllegalCrossThreadCalls = false; ...
阅读全文
摘要:public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { /...
阅读全文
摘要:private void timer2_Tick(object sender, EventArgs e) { lbltime.Text = DateTime.Now.ToString(); if (DateTime.Now.Hour...
阅读全文
摘要:public static void Main(string[] args) { string s = GetMd5("123"); Console.WriteLine(s); Console.ReadK...
阅读全文
摘要://声明父类 class ProductsFather { public double Price { get; set; } public int Count { ...
阅读全文
摘要:class class1 { public static void Main(string[] args) { Person ps = new Person(); ps.KouLan(); IFlya...
阅读全文
摘要:public sealed class Person:继承类名 { }
阅读全文
摘要:public partial class Person { } public partial class Person { }partial修饰符,可以让同类命名空间下出现重名,两个类其实是一个类,用于多人协做时,类名的重复
阅读全文
摘要:class class1 { public static void Main(string[] args) { //使用多态求矩形面积与周长和圆的面积与周长 Shape cl = new Circle(5); ...
阅读全文
摘要:public static void Main(string[] args) { double db = Math.PI; db = Math.Round(db,2); Console.WriteLine(db);...
阅读全文
摘要:1.抽象成员必须标记为abstract,并且不能有任何实现。2.抽象成员必须在抽象类中。3.抽象类不能被实例化4.子类继承抽象类后,必须把父类中的所有抽象成员都重写。(除非子类也是一个抽象类,则可以不重写)5.抽象成员的访问修饰符不能是private6.在抽象类中可以包含实例成员。并且抽象类的实例成...
阅读全文
摘要:class Class1 { static void Main(string[] args) { YuanGong yg = new YuanGong(); JingLi jl = new JingLi(); ...
阅读全文
摘要:static void Main(string[] args) { string source = @"D:\c\集合.avi"; string target = @"C:\Users\Administrator\Desktop\集合2.av...
阅读全文
摘要:FileStream fsRead = new FileStream(@"C:\Users\Administrator\Desktop\u.html",FileMode.OpenOrCreate,FileAccess.Read); byte[] buffer = new ...
阅读全文
摘要:Dictionary dc = new Dictionary(); dc.Add(1, "看了"); dc.Add(2, "没看"); dc.Add(3, "不知道"); dc[1] = "哈哈"; ...
阅读全文
摘要://创建list泛型集合 List ilist = new List(); ilist.Add(1); ilist.Add(9); ilist.AddRange(new int[] { 23...
阅读全文
摘要://创建文件 //File.Create(@"D:\a.txt"); //Console.WriteLine("创建成功"); ////删除文件 //File.Delete(@"D:\a.txt"); ...
阅读全文
摘要://Hashtable键值集合 键必须是维一的 类似于索引 Hashtable ht = new Hashtable(); ht.Add(1, "中国"); ht.Add(2, 123); ht.Add(...
阅读全文
摘要:ArrayList list = new ArrayList(); Random rd = new Random(); for (int i = 0; i <10; i++) { int rNumbe...
阅读全文
摘要:子类可以调用,但实例化的对像不可调用 new object;
阅读全文
摘要:ArrayList alist = new ArrayList(); //集合对像 长度可以改变,类型不限 //添加单个元素可以Add() alist.Add("在在的"); alist.Add(35);...
阅读全文
摘要:Console.WriteLine("输入字符1"); string n1 = Console.ReadLine(); Console.WriteLine("输入字符2"); string n2 = Console.ReadLin...
阅读全文
摘要:string str = "af adsf e4afef3 _asdf $adsf"; char[] chr = { ' ', '_', '$' }; //StringSplitOptions.RemoveEmptyEntries去掉空格 ...
阅读全文
摘要:public static void Main(string[] args) { Stopwatch sw = new Stopwatch(); //程序计时器 StringBuilder str = new StringBuilder...
阅读全文
摘要:string s = "asdf"; //字符转char char[] c = s.ToCharArray(); Console.WriteLine(s[0]); //char转string string s1 =...
阅读全文
摘要:项目右键引用 ,添加要引用的然后在代码用 using 绰用
阅读全文
摘要:public class Students { //创建对像时使用 public Students(string name, int age, char gender, int englist, int chinese, int math) { ...
阅读全文
摘要:作用:帮助我们初始化对像(给对像的每个属性依次的赋值)构造函数是一个特殊的方法1、构造函数没有返回值,连void也不能写2、构造函数名称要和类名一样3、创建对像时会执行构造函数4、构造函数可以重载类中默认有一个构造函数(隐藏的),如果你创建了一个构造函数,不管是有参数的,还是无参数的,他默认的那个无...
阅读全文
摘要:students 类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ClassLibrary1{ p...
阅读全文
摘要:static静态类与非静态类的区别1、在非静态类中可以有实例成员也可以有静态成员2、在调用的时候需要使用对像名.实例成员调用(先要实例化,如person ps=new person(); ps.janzhi;) 在调用静态成员的时候,需要使用类名.静态成员名person.jianzhi() int...
阅读全文
摘要:person类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ClassLibrary1{ clas...
阅读全文
摘要:Preson类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ClassLibrary1{ clas...
阅读全文
摘要:方法的重载参数不同,个数可以相同参数相同,个数不能相同 static void Main(string[] arr) { Console.WriteLine(M(2,3)); Console.ReadKey(); ...
阅读全文
摘要:static void Main(string[] arr) { int[] shuZi; bool bj = false; while (!bj) { ...
阅读全文
摘要:params将方法中实际参数列表中跟可变参数数组类型一致的类型,都处理为数组中的的元素 static void Main(string[] arr) { // int[] numbers={2,3,4,6,7,5,434,341,412} /...
阅读全文
摘要:ref参数能够将一个变量带入方法进行改变,改变完成后再将改变完成后的变量带出方法ref参数要求在方法外必须为值赋值,而方法内可以不赋值static void Main(string[] arr) { int gongzi = 5000; Ji...
阅读全文
摘要:static void Main(string[] arr) { Console.WriteLine("请输入用户名"); string uname = Console.ReadLine(); ...
阅读全文
摘要:常用的参数配置项1、showArrows:是否显示滚动箭头,模式是false;2、maintainPosition:当滚动区重新初始化后,是否保持滚动条的原有位置,默认是true;3、stickToBottom:当maintainPos...
阅读全文
摘要:A IMG { filter:gray;/* IE6-9 */-webkit-filter: grayscale(1);/* Webkit */ }A:hover IMG {FILTER:none;-webkit-filter: grayscale(0)}
阅读全文
摘要:可以自由的给滚动条定义背景,上下按钮,当然不仅仅是颜色,连图片当背景也可以。支持鼠标滚轮,点击滚动条滚轴定位,上下按钮久按加速,兼容firefox,谷歌下载地址
阅读全文
摘要:static void Main(string[] arr) { int max= Class1.GetMax(4, 7); Console.WriteLine(max); Console.ReadKey();...
阅读全文
摘要:static void Main(string[] arr) { int[] names = {4,2,5,7,6,8,9,1,3,0};//Array.Sort(names)数组排序 for (int i = 0; i n...
阅读全文
摘要:static void Main(string[] arr) { string[] names = { "老杨1", "老李2", "老王3", "老牛4", "老虎5", "老磁6" }; for (int i = 0; i < names...
阅读全文
摘要://计算数组中最大值,最小值,平均值和总和 //类中main最先执行 static void Main(string[] args) { //声明一个数组,数组长度一定固定就不能更改了 int[] nums = {...
阅读全文
摘要:元数据相对我们来说通俗点 就是你引用里面引用的那些dll比如 对Thread 按F12不就是提示从元数据,..
阅读全文
摘要:1 //声明结构 结构与枚举区别,一个不用声明类型,一个要声明类型 2 public struct Person 3 { 4 //这里叫字段,做用也是存储内容,变量只可以存一个值,字段可以存多个值 5 ...
阅读全文
摘要://声明枚举 public enum Sesons { 春, 夏, 秋, 冬 } static void Mai...
阅读全文

浙公网安备 33010602011771号