11月18日随笔

今天在云和学院复习了以前的知识,又学习了ArrayList和HashTable

ArrayList实例:

ArrayList arr = new ArrayList();
            int i = 123;
            string str = "宋连城";
            float f = 1.23f;
            decimal d = 2.13m;
            double dou = 22.16;
            arr.Add(i);
            arr.Add(str);
            arr.Add(f);
            arr.Add(d);
            arr.Add(dou);
            arr.Remove(dou);
            arr.RemoveAt(2);

            for (int j = 0; j < arr.Count; j++)
            {
                Console.WriteLine(arr[j]);
            }
            Console.ReadKey();

HashTable实例:

Hashtable hash = new Hashtable();
            string id = "272012321029";
            string name = "宋丽";
            string id1 = "272012321028";
            string name1 = "婷婷";
            hash.Add(id,name);
            hash.Add(id1,name1);
            foreach (DictionaryEntry  item in hash)
            {
                Console.WriteLine(item.Key);
                Console.WriteLine(item.Value);
            }

            int[] array = {12,45,23,89 };
            foreach (var item in array)
            {
                Console.WriteLine(item);
            }
            Console.ReadKey();

foreach语法:

foreach(集合中单个的类型 局部变量名 in 集合对象)

{

–// 循环体

–// 循环体当中“局部变量”表示集合中遍历的数据

}

泛型集合

 List<int> list = new List<int>();
            for (int i = 1; i < 100; i++)
            {
                list.Add(i);
            }
            foreach (var item in list)
            {
                Console.WriteLine(item);
            }
            Console.ReadKey();

Dictionary

Dictionary <TKey,TValue>

Dictionary实例:

 Dictionary<int, string> dic = new Dictionary<int, string>();
            dic.Add(1,"范冰冰");
            dic.Add(2,"周韦彤");
            dic.Add(3,"范玮琪");
            dic.Add(4,"蔡国庆");
            dic.Add(5, "孙俪");
            foreach (var item in dic)
            {
                Console.WriteLine(item.Key);
                Console.WriteLine(item.Value);
            }
            Console.ReadKey();
时间: 2024-08-06 16:06:33

11月18日随笔的相关文章

中国互联:TOP域名11月18日开售

互联网已经成为全球经济命脉 互联网发展30年中,全球人口数目从1985年的48亿增长至2014年71.3亿.据悉,2025年全球人口将突破80亿大关.人口的急速增长的同时将消费市场带向繁荣.在2014年达沃斯论坛中,中华人民共和国国家互联网信息办公室主任指出:"目前中国互联网网站近400万家.中国互联网经济增长速度有两位数,而且是以30%的速度递增." 域名是互联网的敲门砖 在域名发展的历史时间中,可以简单分成:规则--规则+资源两个时段."资源"之声一直是占据着主

10月18日随笔

1 #include<iostream> 2 #include<algorithm> 3 #include<cmath> 4 #include<cstring> 5 #include<cstdio> 6 #include<queue> 7 using namespace std; 8 typedef long long LL; 9 inline int read() 10 { 11 int x=0,f=1;char c=getchar

2014年11月17~11月18日,杨学明老师《企业IT需求收集和实施》内训在湖南长沙某酒店成功举办!

2014年11月17至18日,受湖南某软件企业的邀请,杨学明老师<企业IT需求收集和实施>内训在某长沙某五星级酒店成功举办!来自全国各地的IT高管和企业负责人参加了此次培训.杨学明老师分别从企业IT规划与选型普遍面临的问题和挑战. IT需求及策略. IT建设原则.IT流程体系. IT组织.IT选型步骤.IT实施步骤.实际选型和案例.选型流程分享等进行了讲解,共60多人参加了此次内训,课后大家一致认为课程含金量高,是国内最好的IT规划类课程.

11月18日上午权限管理1:对用户角色的增删改

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-

11月18日下午权限管理2:不同的登录者显示登陆者有的功能

1.做一个登录页面login.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-e

11月19日随笔

今天在云和学院学习了File类 基本操作:判存.复制.移动.删除 基本方法: –File.Exist(); –File.Copy(); –File.Move(); File.Delete() File.Copy(“source”, “targetFileName”, true);//文件拷贝,true表示当文件存在时“覆盖”,如果不加true,则文件存在报异常. File.Exists();//判断文件是否存在 File.Move(“source”, “target”);//移动(剪切) Fil

Week1(11月18日)

Part I:提问  =========================== 代码编写练习 1.为用户登录系统编写模型. 2.将该模型映射到数据库上. 3.编写登录的控制器和视图. Part II:检查 =========================== 1.上堂课的练习效果. Part III:案例学习 =========================== MusicStore的开发故事(教程下载) 第4集:数据访问(视频下载 1, 2 ) 六.更新Browse和Details页面 第5

2018年11月18日 at cronb计划任务及添加删除任务

原文地址:https://www.cnblogs.com/xcj2018/p/10000454.html

(随笔)js获取当前时间并格格式化当前日期 获取date天后的日期(2014年11月27日 16:31:49)

(随笔)js获取当前时间并格格式化当前日期 获取date天后的日期参考网络(2014年11月27日 16:31:49 浙江) // 格式化当前日期 获取date天后的日期    function getNowFormatDate(date) {        var day = new Date();        var Year = 0;        var Month = 0;        var Day = 0;        var CurrentDate = "";