加载中...

随笔分类 -  c#

摘要:1.一个普通的加法如下 internal class Program { private static void Main(string[] args) { int s = sum(10, 20); Console.WriteLine("Sum is: " + s); } private stati 阅读全文
posted @ 2025-02-24 17:02 神乐羊 阅读(13) 评论(0) 推荐(0)
摘要:需要用的包: 把之前的tcp修改成控件 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System 阅读全文
posted @ 2025-02-20 21:21 神乐羊 阅读(39) 评论(0) 推荐(0)
摘要:先添加包 代码部分: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; us 阅读全文
posted @ 2025-02-16 14:44 神乐羊 阅读(21) 评论(0) 推荐(0)
摘要:前端xaml模块 <Window x:Class="Wpf_new.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/ 阅读全文
posted @ 2024-12-13 13:39 神乐羊 阅读(22) 评论(0) 推荐(0)
摘要:给按钮添加点击事件 给 Button 添加属性 Click,在button后任意地方输入Click,在选择,创建Button_Click事件(将事件绑定到新创建的名为Button_Click) private void Button_Click(object sender, RoutedEventA 阅读全文
posted @ 2024-10-02 13:29 神乐羊 阅读(49) 评论(0) 推荐(0)
摘要:两种遍历方法:for和foreach遍历 点击查看代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using 阅读全文
posted @ 2024-08-03 14:50 神乐羊 阅读(28) 评论(0) 推荐(0)
摘要:例子展示: 设置一个动物类,dog类,cat类,使用虚方法改写 点击查看代码 using System; public class Animal { // 声明一个虚方法 public virtual void Speak() { Console.WriteLine("Animal speaks") 阅读全文
posted @ 2024-07-26 10:55 神乐羊 阅读(22) 评论(0) 推荐(0)
摘要:写一个例子 基类敌人类(hp speed 方法 :move ai )派生出来两个类 boos类 type1enemy类 using System.Collections.Generic; using System.Linq; using System.Text; using System.Threa 阅读全文
posted @ 2024-07-25 22:04 神乐羊 阅读(17) 评论(0) 推荐(0)