09 2024 档案

摘要:找不到字典时设置如下 <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Themes/1.xaml"/> <ResourceDictionary Source="/The 阅读全文
posted @ 2024-09-30 16:59 echo-efun 阅读(95) 评论(0) 推荐(0) 编辑
摘要:WindowState="Maximized" //窗口最大化 WindowStyle="None" //不使用wpf自带标题栏 阅读全文
posted @ 2024-09-30 15:32 echo-efun 阅读(25) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 16进制字符转为字节流 /// </summary> /// <param name="str"></param> /// <param name="fromBase"></param> /// <returns></returns> public static 阅读全文
posted @ 2024-09-29 17:29 echo-efun 阅读(9) 评论(0) 推荐(0) 编辑
摘要:CSocketClient info; ModbusMaster master; //public static ModbusTcp2 Instance = new ModbusTcp2("192.168.0.8", 8000); public static ModbusTcp2 Instance 阅读全文
posted @ 2024-09-29 17:28 echo-efun 阅读(65) 评论(0) 推荐(0) 编辑
摘要:类CSocketClient主要包括以下内容: private TcpClient _client; public Thread _connectionThread; private StreamWriter _write; public ClientRecMsgClass GClientRecMs 阅读全文
posted @ 2024-09-29 17:27 echo-efun 阅读(80) 评论(0) 推荐(0) 编辑
摘要:如16进制A要填充为000A string str ="A"; str.PadLeft(4,'0'); 阅读全文
posted @ 2024-09-29 17:26 echo-efun 阅读(7) 评论(0) 推荐(0) 编辑
摘要:1.读取一个或多个保持寄存器的数值 如指令00 02 00 00 00 06 01 03 F2 00 00 06 00 02 事务标识符 00 00 协议标识符 00 06 长度标识符(从站号开始到指令结尾共有6个byte) 01 站号 03 功能码(读取一个或多个保持寄存器的数值) F2 00 起 阅读全文
posted @ 2024-09-29 16:04 echo-efun 阅读(429) 评论(0) 推荐(0) 编辑
摘要:类继承INotifyPropertyChanged接口,然后把List的类型改为ObservableCollection 如下 private ObservableCollection<string> reagentNameList = new ObservableCollection<string 阅读全文
posted @ 2024-09-29 15:30 echo-efun 阅读(21) 评论(0) 推荐(0) 编辑
摘要:1.git init 2.git clone 链接 3.git remote -v 4.ls 5.cd 文件夹 6.git remote -v 7.git branch -v 8.git status 9.git add 要添加的文件夹 10.git commit -m "提交说明" 11.git 阅读全文
posted @ 2024-09-27 14:11 echo-efun 阅读(9) 评论(0) 推荐(0) 编辑
摘要:private System.Threading.Mutex mutex; public App() { this.Startup += new StartupEventHandler(App_Startup); } private void App_Startup(object sender, S 阅读全文
posted @ 2024-09-26 17:30 echo-efun 阅读(66) 评论(0) 推荐(0) 编辑
摘要:1.创建拖放对象 1.1创建一个圆自定义控件,UI代码如下(Circle.xaml): <UserControl x:Class="WpfApp1.Circle" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xm 阅读全文
posted @ 2024-09-25 11:01 echo-efun 阅读(154) 评论(0) 推荐(0) 编辑
摘要:拖放通常指一种数据传输的方法:使用鼠标(或类似其他设备)选择一个或多个对象,将其拖至用户界面(UI)中的目标位置 1.拖放操作通常涉及两个参与方 *拖动对象、拖放目标 *拖动对象和拖放目标可能是相同应用程序或不同应用程序中的UI元素 *在 Internet 区域中 OLE 拖放无效 *拖放属于广义的 阅读全文
posted @ 2024-09-25 10:38 echo-efun 阅读(53) 评论(0) 推荐(0) 编辑
摘要:Visual Studio 中的键盘快捷方式 阅读全文
posted @ 2024-09-25 09:58 echo-efun 阅读(13) 评论(0) 推荐(0) 编辑
摘要:1.打开网卡高级设置 右击任务栏中网络图标 出现如下菜单选项 点击“打开‘网络和Internet’设置”,出现如下类似界面 鼠标点击“更改适配器选项”,出现如下界面: 右击堆栈设备所链接网络图标 鼠标点击“属性”选项,出现如下界面: 单击“配置”按钮,出现如下界面: 选择“高级”tab选项,界面显示 阅读全文
posted @ 2024-09-24 17:05 echo-efun 阅读(1506) 评论(0) 推荐(0) 编辑
摘要:参数 dragSourceDependencyObject 对依赖项对象的引用(该对象是被拖动数据的源)。 dataObject 包含被拖动数据的数据对象。 allowedEffectsDragDropEffects DragDropEffects 值中的一个,指定拖放操作的允许效果。 返回 Dra 阅读全文
posted @ 2024-09-24 13:29 echo-efun 阅读(36) 评论(0) 推荐(0) 编辑
摘要:1.Assembly.CreateInstance 从程序集中查找某个类型,然后使用系统激活器创建它的实例,有以下三种方式实现: CreateInstance(String) 使用区分大小写的搜索,从此程序集中查找指定的类型,然后使用系统激活器创建它的实例。 CreateInstance(Strin 阅读全文
posted @ 2024-09-21 16:04 echo-efun 阅读(39) 评论(0) 推荐(0) 编辑
摘要:匿名类型: *提供了一种方便的方法,用来将一组只读属性封装到单个对象中,而无需首先显示定义一个类型 *类型名由编译器生成 *结合new运算符和对象初始值设定项创建匿名类型 *匿名类型是class类型,直接派生自object *如下示例,查找年龄是两岁的猫 public class Cat { // 阅读全文
posted @ 2024-09-20 11:30 echo-efun 阅读(35) 评论(0) 推荐(0) 编辑
摘要:使用对象初始值设定项: *在创建对象时,向对象的任何可访问字段或属性分配值 *可为构造函数指定参数或忽略参数 public class Cat { // Auto-implemented properties. public int Age { get; set; } public string? 阅读全文
posted @ 2024-09-20 10:45 echo-efun 阅读(23) 评论(0) 推荐(0) 编辑
摘要:自动实现的属性:*实例如下 public string Name { get; set; } *属性声明更加简洁 *前提是:不需要任何其他逻辑 *输入prop后按tab键可自动生成 *不能在接口中,声明自动实现的属性 *自动实现属性初始化 public string FirstName { get; 阅读全文
posted @ 2024-09-19 17:09 echo-efun 阅读(32) 评论(0) 推荐(0) 编辑
摘要:init关键字: 1.init在属性或索引器中定义访问器方法 2.仅在对象构造期间为属性或索引器元素赋值 3.init强制实施不可变性(对象一旦初始化,将无法更改) 4.如下同时定义get和init访问器 class Person_InitExample { private int _yearOfB 阅读全文
posted @ 2024-09-19 17:01 echo-efun 阅读(139) 评论(0) 推荐(0) 编辑
摘要:1.fixed语句 *固定用于指针操作的变量; *可防止垃圾回收器重新定位可移动变量,并声明指向该变量的指针; *固定变量的地址,在语句的持续时间内不会更改 *fixed语句中,只能使用声明的指针,声明的指针是只读的,无法修改 *fixed语句只能在不安全的上下文中使用 static void Ma 阅读全文
posted @ 2024-09-19 11:16 echo-efun 阅读(496) 评论(0) 推荐(0) 编辑
摘要:xml位于命名空间中时查找 static void Main(string[] args) { XElement root = XElement.Parse(@"<aw:Root xmlns:aw='http://www.efun.com'> <aw:Child1> <aw:GrandChild1> 阅读全文
posted @ 2024-09-18 17:19 echo-efun 阅读(35) 评论(0) 推荐(0) 编辑
摘要:static void Main(string[] args) { XElement purchaseOrder = XElement.Load("Contacts.xml"); string partNos = (string)(from item in purchaseOrder.Descend 阅读全文
posted @ 2024-09-18 17:09 echo-efun 阅读(12) 评论(0) 推荐(0) 编辑
摘要:using System.Xml.Linq; static void Main(string[] args) { XElement contacts = new XElement("Contacts", new XElement("Contact", new XElement("Name", "Pa 阅读全文
posted @ 2024-09-18 16:10 echo-efun 阅读(9) 评论(0) 推荐(0) 编辑
摘要:网卡部分高级设置 1.节能以太网 Energy Efficient Ethernet 2.自动关闭Gigabit Automatically Close Gigabit 3.电量低时降低网络速度 Reduce Speed On Power Down 4.流控制 Flow Control 5.千兆主从 阅读全文
posted @ 2024-09-18 15:38 echo-efun 阅读(290) 评论(0) 推荐(0) 编辑
摘要:1.查询一定范围数字 static void QueryInt() { // Specify the data source. int[] scores = { 97, 92, 81, 60 }; // Define the query expression. IEnumerable<int> sc 阅读全文
posted @ 2024-09-18 13:55 echo-efun 阅读(8) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示