随笔分类 -  C# about

发现的新东西
寻找某个域账户的所有属性
摘要:DirectoryEntry adRoot1 = new DirectoryEntry("LDAP://具体的域", account, pwd, AuthenticationTypes.Secure); DirectoryEntry ou = adRoot1.Children.Find("OU=CS 阅读全文

posted @ 2025-02-28 15:45 炼金师 阅读(2) 评论(0) 推荐(0) 编辑

自用MySql数据库工具类
摘要:需要先在nuget上搜索并安装 MySql.Data 包 using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.Data; public class DBUtil { pr 阅读全文

posted @ 2025-02-08 15:16 炼金师 阅读(3) 评论(0) 推荐(0) 编辑

C# Exchange ews 自用收发邮件工具类
摘要:网上找了好久的代码,结合微软的文档和网上代码总结下来这个工具类(对邮件的附件的操作暂时没有写,以后用到了再补上) 前置条件: 工具 -> NuGet包管理器 -> 管理解决方案的NuGet包管理器,选浏览,然后搜索 Microsoft.Exchange.WebServices.Data 期间我报错过 阅读全文

posted @ 2023-09-27 10:23 炼金师 阅读(248) 评论(0) 推荐(0) 编辑

巡路算法
摘要:比较闲,看了网上的思路后写了一个玩玩 public class MapManager { private int mapMaxRow = 0; private int mapMaxCol = 0; private int[,] mapInfo; //终点坐标 private int finalRow 阅读全文

posted @ 2022-10-24 14:04 炼金师 阅读(18) 评论(0) 推荐(0) 编辑

wpf scrollview用法
摘要:效果图: 代码: private void Window_Loaded(object sender, RoutedEventArgs e) { //横向滑条禁用,如果想横着拉就就竖向禁用、横向启用 m_scroller.HorizontalScrollBarVisibility = ScrollBa 阅读全文

posted @ 2022-09-29 14:20 炼金师 阅读(262) 评论(0) 推荐(0) 编辑

c#程序生成dmp文件并查看调试
摘要:前人写的项目频繁闪退,实在找不到原因,所以想到了以前公司服务端使用dmp日志排查问题的方法 c#程序要生成dmp文件的话,需要使用一个辅助工具类,下面上代码: using System; using System.Diagnostics; using System.IO; using System. 阅读全文

posted @ 2022-06-17 15:35 炼金师 阅读(967) 评论(0) 推荐(0) 编辑

自己整理的串口工具类
摘要:整理自己很久以前代码的时候发现的,那时的我没有写笔记的习惯,看着以前代码不好看,改了一下,也不知道能不能用了,好久没搞了 using System; using System.Threading; using System.IO.Ports; public class Serial { //默认 p 阅读全文

posted @ 2022-05-03 23:39 炼金师 阅读(122) 评论(0) 推荐(0) 编辑

rabbitmq用法
摘要:首先nuget上下载rabbitmq 版本要5.1.2 然后要自己搞一台服务器,上面要部署mq的服务端(具体教程网上很多) 接下来就是代码了,目前例两种模式,以后再有用到再说, 需要注意一下,不能同时定义多个队列名一样的接收端,这样会造成:定义了多少个同样的队列名,就要发定义同样队列名接收端个数次消 阅读全文

posted @ 2021-12-08 09:33 炼金师 阅读(58) 评论(0) 推荐(0) 编辑

c# 调用jar包
摘要:c#调用jar包需要有三步(四步) 1.转换jar成dll 2.安装ikvm包 3.引入转换号的dll 4.愉快地调用 1.转换jar成dll: 需要用到一个工具,我就放在这里面了 https://share.weiyun.com/N3mhQTeo 打开cmd窗口,然后cd到"ikvm.exe"所在 阅读全文

posted @ 2021-06-29 14:29 炼金师 阅读(2743) 评论(0) 推荐(0) 编辑

c# sqlserver数据库工具类
摘要:using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Text; /// <summary> /// 数据库工具 /// </summa 阅读全文

posted @ 2021-06-24 08:37 炼金师 阅读(441) 评论(2) 推荐(0) 编辑

c# sha256hex
摘要:/// <summary> /// 字节数组转换为Hex字符串 /// </summary> /// <param name="data"></param> /// <param name="toLowerCase"></param> /// <returns></returns> private 阅读全文

posted @ 2021-06-22 15:26 炼金师 阅读(928) 评论(0) 推荐(0) 编辑

C# HMACSHA256加密
摘要:/// <summary> /// hmacsha256加密 /// </summary> /// <param name="message">内容</param> /// <param name="secret">密钥</param> /// <param name="encoding">你懂的< 阅读全文

posted @ 2021-06-22 15:23 炼金师 阅读(1078) 评论(0) 推荐(0) 编辑

c#日志生成(支持多线程)
摘要:using System; using System.Collections.Generic; using System.IO; using System.Text; /// <summary> /// 打印error类 /// </summary> public class LogUtil { p 阅读全文

posted @ 2021-05-04 12:12 炼金师 阅读(396) 评论(0) 推荐(0) 编辑

c# http方法工具类整合
摘要:using System; using System.IO; using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Text; us 阅读全文

posted @ 2021-02-05 10:35 炼金师 阅读(1113) 评论(0) 推荐(0) 编辑

c# 生成n位某系统内唯一字符串
摘要:注意,仅适用于某一系统内,思路是用ascill码去累加,累加到一定次数重置,使用时需配合datetime去拼接,这样可以达到理论上就算在同一时间内同时触发,也能保证生成的码不重复。 下面直接贴代码。 using System; using System.IO; /// <summary> /// 生 阅读全文

posted @ 2021-01-18 15:48 炼金师 阅读(93) 评论(0) 推荐(0) 编辑

C#版escape unescape
摘要:/// <summary> /// Escape方法 /// </summary> /// <param name="s"></param> /// <returns></returns> public static string Escape(string s) { StringBuilder s 阅读全文

posted @ 2020-12-11 16:07 炼金师 阅读(127) 评论(0) 推荐(0) 编辑

C# 编码解码
摘要:string test = "小飞侠"; test = HttpUtility.UrlEncode(test, Encoding.UTF8);//编码 test = HttpUtility.UrlDecode(test, Encoding.UTF8);//解码 阅读全文

posted @ 2020-12-11 15:28 炼金师 阅读(247) 评论(0) 推荐(0) 编辑

asp.net跨域问题
摘要:方案一: web.config中的“system.webServer”标签页中添加 <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Contro 阅读全文

posted @ 2020-12-02 16:54 炼金师 阅读(100) 评论(0) 推荐(0) 编辑

C# crc16modbus
摘要:using System; public class Crc { /// <summary> /// 判断数据中crc是否正确 /// </summary> /// <param name="datas">传入的数据后两位是crc</param> /// <returns></returns> pu 阅读全文

posted @ 2020-11-19 17:31 炼金师 阅读(535) 评论(0) 推荐(0) 编辑

C# 对newtonsoft.json对象进行ascii排序
摘要:/// <summary> /// 获取排序后的json字符串 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static string GetSortStrJson(object obj) 阅读全文

posted @ 2020-11-11 09:58 炼金师 阅读(1561) 评论(2) 推荐(1) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

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