using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace Roading001{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void pictureBox1_Paint(object send Read More
posted @ 2010-01-21 20:17 robin.won Views(525) Comments(1) Diggs(0)
//编译时常量public const int constValue=100;//运行时常量public static readonly int readonlyValue=200;代码将被编译成MSIL(微软中间语言),在MSIL中,constValue直接被100所替换,且以后不会再更改;readonlyValue则只是变成对其变量的引用,其值在以后还可以改变。所以一般选择readonly变量,这样比较灵活;但是诸如PI等于3.1415926这种一百年不变的变量,可以使用const。——摘自《Effective C#》 Read More
posted @ 2010-01-21 20:05 robin.won Views(193) Comments(0) Diggs(0)
double a=2;double b=Math.Pow(a,3);可得b=8专有的平方根函数Math.Sqrt(a)也可由Math.Pow(a,0.5)代替。 Read More
posted @ 2010-01-21 19:35 robin.won Views(1959) Comments(0) Diggs(0)