这几天在看一本C#和VS2010结合的小书,
可以在约懂懂VS开发C#的东东。
讲得不深,适合我无脑的机械照搬。。
特别是想熟悉一下常用控件和数据库及网络部份。GDI+真的没兴趣呀。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication4 { class MyClass { private string id = ""; private string name = ""; public string ID { get { return id; } set { id = value; } } public string Name { get { return name; } set { name = value; } } } class Program { public static int Add(int x, int y) { return x + y; } public static double Add(int x, double y) { return x + y; } public static int Add(int x, int y, int z) { return x + y + z; } static void Main(string[] args) { int x = 3, y = 5, z = 7; double y2 = 5.5; MyClass myclass = new MyClass(); myclass.ID = "BH001"; myclass.Name = "TM1"; Console.WriteLine(myclass.ID + " " + myclass.Name); Console.WriteLine(x + " + " + y + " = " + Add(x, y)); Console.WriteLine(x + " + " + y2 + " = " + Add(x, y2)); Console.WriteLine(x + " + " + y + " + " + " z " + " = " + Add(x, y, z)); Console.Read(); } } }