摘要: 1、DLR Dynamic Language Runtime(动态语言进行时),C# 4 的动态功能是其中的一部分。它是添加一系列服务到CLR中,允许添加动态语言,如Ruby 和 Python,使得C# 具备和这些动态语言相同的动态功能。 位于System.Dynamic 和 System.Runt 阅读全文
posted @ 2022-07-13 14:04 xunzf 阅读(440) 评论(0) 推荐(0)
摘要: 单记录控件很容易忘,使用才能记得牢固,这边就通过一个音乐播放器的小项目来巩固自己的Winform学习 这个音乐播放器用到了以下控件: Label 标签,Button按钮、ListBox列表框、Timer控件、TableLayoutPanel控件、TracBar控件以及自定义控件 AxWindowsM 阅读全文
posted @ 2022-07-12 21:01 xunzf 阅读(1143) 评论(0) 推荐(0)
摘要: 需要添加外部引用 Windows Media Player,后缀为 .dll的 using WMPLib; 实现播放音乐文件效果。 以上是音频文件,每个文件都是单独的一个钢琴音频。 实现代码 static void Main(string[] args) { while (true) { try { 阅读全文
posted @ 2022-07-12 15:44 xunzf 阅读(86) 评论(0) 推荐(0)
摘要: 一、概述 关键字:from、where、orderby、descending、select 表达式必须以 from 开头,以select 或者group 结束。在这之间可以使用 where、orderby、join、let和其他 from子句。 下面用几个实例来了解LINQ的拓展方法 1 class 阅读全文
posted @ 2022-07-12 10:34 xunzf 阅读(81) 评论(0) 推荐(0)
摘要: 学到LINQ碰到 IFormattable 看不懂,刚好string.Format 也不是很懂,这里一起学习 参考文章:点这里 string.Format 方法时 string 类提供的静态方法,一般最多使用的时两个参数的重载。 var name = "ZhangSan"; var msg = st 阅读全文
posted @ 2022-07-11 09:31 xunzf 阅读(86) 评论(0) 推荐(0)
摘要: 1、枚举器和可枚举类型 为什么数组可以使用 foreach 来遍历自己的元素呢?原因是数组可以按需提供一个叫做枚举器(enumerator)的对象。获取对象枚举器的方法是通过调用对象的 GetEnumerator 方法。实现GetEnumerator 方法的类型叫做可枚举类型。 foreach 结构 阅读全文
posted @ 2022-07-08 08:53 xunzf 阅读(133) 评论(1) 推荐(1)
摘要: 定义: 特性(Attribute)是用于在运行时传递程序中各种元素(比如类、方法、结构、枚举、组件等)的行为信息的声明性标签。 预定义特性(Attribute) .Net 框架提供了三种预定义特性: AttributeUsage Conditional Obsolete AttributeUsage 阅读全文
posted @ 2022-07-07 14:59 xunzf 阅读(121) 评论(0) 推荐(0)
摘要: 定义: 异常是在程序执行期间出现的问题。C# 中的异常是对程序运行时出现的特殊情况的一种响应 语法格式: try{ // 存在引起异常的语句 } catch( ExceptionName e2 ) { // 错误处理代码 } catch( ExceptionName eN ) { // 错误处理代码 阅读全文
posted @ 2022-07-07 13:32 xunzf 阅读(67) 评论(0) 推荐(0)
摘要: 一、集合接口和类型 大多数的集合类都可在 System.Clooections 和System.Collections.Generic名称空间中找到。泛型集合类位于 System.Collections.Specialized名称空间中。线程安全的集合类位于 System.Collections.C 阅读全文
posted @ 2022-07-06 16:35 xunzf 阅读(244) 评论(0) 推荐(0)
摘要: 代码示例 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Li 阅读全文
posted @ 2022-07-04 16:22 xunzf 阅读(75) 评论(0) 推荐(0)