11 2022 档案
摘要:BitConverter 类进行字节转换——MSDN byte[] dd = BitConverter.GetBytes(49490); // 转换出来的是:低位在前,高位在后,也就是 ABCD Console.WriteLine(BitConverter.ToInt32(dd, 0)); dd =
阅读全文
摘要:一般而言: **输入寄存器:**输入寄存器的值对于master来说就只能读取。 // 只读 **保持型寄存器:**值可以读取也可以修改。// 可读可写
阅读全文
摘要:public static void ForceClearDir(string dirPath) { DirectoryInfo dirInfo = new DirectoryInfo(dirPath); dirInfo.Delete(true); } 注:path是你要删除的非空目录; true:
阅读全文
摘要:文件夹路径最好用微软的反斜杠\\形式。 public void BackUpFiles(string srcDir, string dstDir) { Directory.CreateDirectory(dstDir); if (!Directory.Exists(srcDir)) { return
阅读全文
摘要:用这个: lstbDynamicNote.ScrollIntoView(lstbDynamicNote.Items[lstbDynamicNote.Items.Count - 1]); private void DynamicNoteShow(string dynamicNote) { if (ls
阅读全文
摘要:续这篇测试:https://www.cnblogs.com/huvjie/p/16909290.html 测试页面: <Window x:Class="MyWPFSimple3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xa
阅读全文
摘要:ViewModel: 测试:这样子赋值是没问题,绑定能找到派生类元素: public MainWindow() { InitializeComponent(); Myc myc = new VMMainWindow(); DataContext = myc; } CS: public class V
阅读全文
摘要:主界面 <Window x:Class="MyWPFSimple2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/
阅读全文
摘要:TimeSpan timeSpan = DateTime.Now.TimeOfDay;
阅读全文
摘要:1.首先添加引用 System.Windows.Forms.dll WindowsFormsIntegration.dll System.Windows.Forms.DataVisualization.dll 2.xaml添加命名空间 xmlns:wfi="clr-namespace:System.
阅读全文
摘要:安装 Nuget 包 ▲ 这个没什么说的。 log4net.config 右键项目新建程序配置: log4net.config <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!--配置节点--> <s
阅读全文
摘要:▲ https://www.cnblogs.com/chillsrc/p/4482691.html
阅读全文
摘要:经常要考虑的,后台的耗时操作不要卡死主界面的问题。 <StackPanel VerticalAlignment="Center"> <Label x:Name="lblHello">欢迎你光临WPF的世界!</Label> <Button Name="btnThd" Click="btnThd_Cl
阅读全文
摘要:byte[] a = { 1, 2, 3 }; byte[] b = { 99, 3, 2, 1, 99 }; byte[] c = { 0, 0 }; byte[] ab = a.Concat(b).Concat(c).ToArray(); foreach (byte v in ab) { Con
阅读全文
摘要:样式通上一篇:https://www.cnblogs.com/huvjie/p/16867618.html xaml: <Window x:Class="MyWPFSimple1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/x
阅读全文
摘要:MyTextBox.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/
阅读全文
摘要:如果需要组织在一起的内容能够自由的缩放,则可以使用 ViewBox 元素。
阅读全文
摘要:<?xml version="1.0" encoding="utf-8"?> <Test> <Person name="孙悟空" age="500" /> </Test> static void Main() { //Write(); //Modify(); GetVal(); Console.Re
阅读全文
摘要:测试实体: class Test { public int Age { get; set; } = 1; public string Sex { get; set; } = "男"; public Name Name { get; set; } = new Name() { Name_ = "周杰伦
阅读全文
摘要:引入命名空间: xmlns:system="clr-namespace:System;assembly=mscorlib" XAML: <Window x:Class="WpfApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006
阅读全文