
C# 蓝牙通讯
核心代码public class BluetoothHepler{ private BluetoothClient _bluetoothClient; private BluetoothDeviceInfo _connectedDevice; private NetworkStream _bluetoothStream; private Thread _receiveThread; private bool _isReceiving; // 事件定…
核心代码public class BluetoothHepler{ private BluetoothClient _bluetoothClient; private BluetoothDeviceInfo _connectedDevice; private NetworkStream _bluetoothStream; private Thread _receiveThread; private bool _isReceiving; // 事件定…
using System;using System.IO;class FileByteInsertion{ static void Main(string[] args) { string sourceFilePath = "source.pdf"; // 源文件路径 string outputFilePath = "output.pdf"; // 输出文件路径 int insertionPosition = 10…
// 判断文件是否为只读public bool IsFileReadOnly(string filePath){ try { // 获取文件的属性 FileAttributes attributes = File.GetAttributes(filePath); // 检查只读属性 return (attributes & FileAttributes.ReadOnly) == Fi…
2025-04-25 更新,防止忘了密钥,添加可找回密钥功能加密工具可以加密任何文件,如txt,word,PPT,Excel,PDF,图片,视频...等任何文件。此加密工具有两个版本版本1:没有给自己留后门,加密之前一定要记住自己的密钥,一但忘了密钥,无人可以解密。版本2:给自己留了后门,…
using System;using System.Data;using System.Data.SQLite;namespace LQWVJE.DAL{ public static class SQLiteHelper { /// summary /// ConnectionString样例:Data Source=Test.db3;Pooling=true;FailIfMissing=false /// /summary…
public void Print(string filePath) { // 调用系统默认程序打开并打印文件(wrod,excel,pdf,txt等),但电脑上一定要安装默认打开文件的软件 try { // 使用Process.Start打开文件并传递打印参数,选择的打印机是电脑默认的打印机 Process…
帮助类public class ExcelHelper{ private string templatePath; private string newFileName; private string templdateName; private string sheetName; public string SheetName { get { return sheetName; } set { sheetName = va…
winform 设置devExpress 设置gridControl 指定的例可以编辑,其它的不能编辑核心代码如下//窗体启动加载时给gridview1注册下面事件,注册代码 gridView1.ShowingEditor += GridView1_ShowingEditor;private void GridView1_ShowingEditor(object sender, System.ComponentMode…
拦截指定IPhttp { # ... 其他配置 ... server { listen 80; server_name example.com; # 拒绝特定 IP 访问 deny 192.168.1.100; # 更复杂的规则,例如拒绝一系列 IP deny 192.168.2.0/24; deny 172.12.0.0/16;…
public DataTable CreateDataTable(){ DataTable dt = new DataTable("testTable");//创建名字testTable的DataTable DataColumn DcAutoId = new DataColumn("tId", typeof(int)); DcAutoId.AutoIncrement = true;//是否自动自增 DcAutoId.AutoIncrementSeed =…