11 2021 档案
摘要:
阅读全文
摘要:客户端向服务器发送文件: 服务器: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Net.Sockets; usin
阅读全文
摘要:前缀 int a = 0xFF; 十六进制,a=255 int b = 0B101; 二进制,b=5 16进制前缀 0x 10进制 0d 一般不用写 8进制前缀 0 2进制 0b 八进制在C#中没有具体的表示,可以使用 int v=Convert.ToInt32("10", 8); // 10代表你
阅读全文
摘要:通过 & 位与操作,然后 >> 移位。 public int getHeight4(byte data){//获取高四位 int height; height = ((data & 0xf0) >> 4); return height; } public int getLow4(byte data)
阅读全文
摘要:使用 EventHandler<> 委托来实现标准事件,通过 EventArgs 传递事件参数,其本身不能传递任何参数,需要被继承。 using System; using System.Collections.Generic; using System.Linq; using System.Tex
阅读全文
摘要:Topmost属性控制窗口置顶,WindowState属性控制窗体最大化,最小化,还原等状态。 private void SetTopMost_Checked(object sender, RoutedEventArgs e) { Topmost = SetTopMost.IsChecked is
阅读全文
摘要:SerialPort 是 C# 的串口类。 先创建一个串口实例对象: _serialPort = new SerialPort(); 基本的串口参数属性 BaudRate // 波特率 Parity // 校验位:奇校验,偶校验,无校验 DataBits // 数据位:6,7,8 StopBits
阅读全文
摘要:<Window x:Class="WpfApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006
阅读全文
摘要:<Window.Resources> <Style TargetType="Button"> <Setter Property="FontFamily" Value="./Resources/#SF2015"/> </Style> </Window.Resources> <Grid> <StackP
阅读全文
摘要:C#程序 :是由一个或多个类型声明组成; // 面向对象,面向接口编程,都依赖的是类型。 C程序 :一组函数和数据类型; C++程序:一组函数和类。 参考: 《C# 图解教程》—— P23
阅读全文