![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#学习之路
学习C#的开始,记录学习中的小知识,希望与大家分享
abel.xiang
从事测试,想通过编程来提高自己。
展开
-
ListBox控件—列表控件--常用的属性和方法
ListBox控件—列表控件 --常用的属性和方法Items:public ObjectCollection Items {get; }摘要: 该属性使用户可以获取当前存储在ListBox中的项列表的引用,可以在集合中添加项、移除项、获取项计数返回结果: System.Windows.Forms.ListBox.ObjectCollection,表示 System.Windows.Forms.ListBox中的项实例:listBox1.Items.Add("12月");原创 2021-04-08 15:18:11 · 4252 阅读 · 0 评论 -
C#之路:枚举
枚举是用户定义的整数类型,在声明枚举时,要指定该枚举的实例可以包含的一组可以接受的值。语法:enum <enum_name>{ enumeration list};enumeration list:用逗号分隔开的标识符列表namespace study1230{ class Program { public enum Week...原创 2019-12-31 11:50:08 · 88 阅读 · 0 评论 -
C#之路:程序流控制
条件语句1.if语句语法: if(Condition) Statements; else Statements;2.switch语句语法:switch(integerA){ case1: break; case2: break; case3:...原创 2019-12-31 11:48:37 · 166 阅读 · 0 评论 -
C#之路:数据类型
值类型与引用类型值类型:直接存储其值,存储在堆栈中(stack)引用类型:存储对值得引用,存储在托管堆上namespace study1230{ class Program { public class Vector { public int value; } static void M...原创 2019-12-31 11:46:13 · 151 阅读 · 0 评论 -
C#之路:变量
C#之路:变量语法:datatype identifier;编译器实际是不允许直接使用声明的变量,需要对其进行初始化。若需要在一条语句中同时声明几个相同类型的变量,需要使用逗号隔开每个变量;同一条语句只能声明同类型的变量。int i = 10, y = 20;``int i = 10;bool y = true;变量的作用域:1.只要类在某个作用域内,其字段(成员变量)也在该作...原创 2019-12-30 11:51:39 · 617 阅读 · 0 评论 -
C#之路:Hello World
编程工具:Visual Studio 2015简单的第一个程序:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using static System.Console;namespace _1_hello_w...原创 2019-11-21 10:24:59 · 106 阅读 · 1 评论