随笔分类 -  C#

摘要:题目是刚需,直接看源码 NET版 /// <summary>AES加密 java对称版</summary> /// <param name="text">明文</param> /// <param name="key">密钥,长度为16的字符串</param> /// <param name="iv 阅读全文
posted @ 2022-09-23 16:15 清风神剑 阅读(167) 评论(0) 推荐(0) 编辑
摘要:本文版本Framework4.6.1 +log4 2.0.15+MVC5 Nuget安装 log4net 配套log4net.config,放App_Data下 <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSectio 阅读全文
posted @ 2022-09-20 16:16 清风神剑 阅读(186) 评论(0) 推荐(0) 编辑
摘要:记录一下 Process cmdProcess = new Process(); cmdProcess.StartInfo.FileName = "cmd.exe"; cmdProcess.StartInfo.RedirectStandardInput = true;//是否可以输入 cmdProc 阅读全文
posted @ 2022-09-07 14:17 清风神剑 阅读(1089) 评论(0) 推荐(0) 编辑
摘要:需求背景:企业微信的文件图片音频视频都需要在本系统,不能放微信存着 框架:.NET6 系统:Windows10,WindowsServer2016 企业微信接口 微信消息类型枚举类 /// <summary> /// 微信消息类型枚举 /// </summary> public static cla 阅读全文
posted @ 2022-09-07 13:54 清风神剑 阅读(230) 评论(0) 推荐(0) 编辑
摘要:ElasticSearch 官网 简介 Elasticsearch是一个分布式、高扩展、高实时的搜索与数据分析引擎。它能很方便的使大量数据具有搜索、分析和探索的能力。充分利用Elasticsearch的水平伸缩性,能使数据在生产环境变得更有价值。Elasticsearch 的实现原理主要分为以下几个 阅读全文
posted @ 2022-08-17 19:57 清风神剑 阅读(259) 评论(0) 推荐(0) 编辑
摘要:官方文档 参考文档 以前的枚举命名规则 之所以用10开头而不用1,2,3,4,是考虑到业务变更频繁,可以在中间插10个状态,如此扩展性相对较好。 有些业务场景判断逻辑可以用 10<=x<=30这种逻辑来判断,在中间插状态则不需更改代码。为什么使用200而不是0来存草稿/暂存状态,则与个人习惯有关。 阅读全文
posted @ 2022-06-17 09:47 清风神剑 阅读(308) 评论(0) 推荐(0) 编辑
摘要:前提:在阿里配置好有API权限的账号与角色 环境:VS2022 NET6 记录时间:2022年6月10日 14:39:04 一、安装依赖 Aliyun.Acs.Sts Aliyun.OSS.SDK.NetCore 二、获取sts代码 using Aliyun.Acs.Core; using Aliy 阅读全文
posted @ 2022-06-10 14:41 清风神剑 阅读(193) 评论(0) 推荐(0) 编辑
摘要:using using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Math; using System; using System.IO; using Syste 阅读全文
posted @ 2022-05-13 15:07 清风神剑 阅读(468) 评论(0) 推荐(0) 编辑
摘要:原文链接 问题描述: 发送邮件程序,突然某一天遇到不能发送邮件。 IIS可以正常发送邮件 服务与程序不能发送 程序在本机能发送,在服务器不能发送,说明不是程序问题 一定有东西阻止了程序发送邮件 IIS能发送,说明不是端口问题,也大胆假设不存在端口同时占用的情况。。这个很容易验证,关闭IIS,启动程序 阅读全文
posted @ 2021-08-05 10:59 清风神剑 阅读(774) 评论(0) 推荐(0) 编辑
摘要:域名不要带https等协议,可以查出来 using System; using System.Net.Security; using System.Net.Sockets; using System.Security.Authentication; using System.Security.Cry 阅读全文
posted @ 2021-08-02 09:33 清风神剑 阅读(699) 评论(0) 推荐(0) 编辑
摘要:https://gitee.com/ZJ69719496/console-ext/blob/master/ConsoleColor/ConsoleExt.cs#源文档 已发布到nugethttps://www.nuget.org/packages/ConsoleExtClass/ 安装Install 阅读全文
posted @ 2021-05-17 16:42 清风神剑 阅读(128) 评论(0) 推荐(0) 编辑
摘要:using Aspose.Words;using Aspose.Words.Drawing;using Aspose.Words.Tables; /// <summary> /// 行合并,根据同名合并,同名必须先排序排好 /// </summary> /// <param name="table" 阅读全文
posted @ 2021-04-06 17:20 清风神剑 阅读(1128) 评论(0) 推荐(0) 编辑
摘要:安装NPOI.Excel ,NPOI using System;using System.Collections.Generic;using System.DirectoryServices;using System.IO;using System.Reflection;using Newtonso 阅读全文
posted @ 2021-03-20 13:45 清风神剑 阅读(644) 评论(0) 推荐(0) 编辑
摘要:docx插入域基本方法 打开文件 AsposeWordHelper helper = new AsposeWordHelper(); string templatePath = HttpContext.Current.Server.MapPath("~/Word/11.docx"); //模板路径 阅读全文
posted @ 2021-03-19 17:16 清风神剑 阅读(1141) 评论(0) 推荐(0) 编辑
摘要:导出Excel在谷歌没问题,在IE下就。。。不得不吐槽,我用微软的技术导出微软的东西居然乱码,在谷歌居然不乱码。。。 解决办法:先贴高手的 https://blog.csdn.net/u014353113/article/details/84784680 /// <summary> /// 通过流导 阅读全文
posted @ 2020-02-25 17:22 清风神剑 阅读(660) 评论(2) 推荐(0) 编辑
摘要:处理图片的时候发生 GDI+中发生一般性错误 我知道的原因有4个 1. 相应的帐户没有写权限。 解决方法:增加权限,赋予 NETWORK SERVICE 帐户以写权限。 2. 指定的物理路径不存在。解决方法:在调用 Save 方法之前,先判断目录是否存在,若不存在,则创建。 网络中应该使用虚拟路径, 阅读全文
posted @ 2019-10-24 14:35 清风神剑 阅读(1086) 评论(0) 推荐(0) 编辑
摘要:参考文档 添加host.json文件 在Program.cs中修改CreateWebHostBuilder方法 运行 阅读全文
posted @ 2019-04-11 17:28 清风神剑 阅读(5593) 评论(11) 推荐(1) 编辑
摘要:using System.IO; static string configFileName = "config.json"; //不存在就直接新建文件夹 public static void WriteConfig(string content) { File.WriteAllText(configFileN... 阅读全文
posted @ 2019-04-10 17:19 清风神剑 阅读(207) 评论(0) 推荐(0) 编辑
摘要:这里有个坑,初始化时不能变色,必须等datagrid完成渲染后才能进行这种行变色。 因而先把form show 出来之后才执行变色方法。这个方法因为莫名其妙的BUG会导致变色不是我们想要的效果!! 第二种方法。用datagrid 的 Dg_LoadingRow方法 阅读全文
posted @ 2019-04-03 11:39 清风神剑 阅读(1865) 评论(0) 推荐(0) 编辑

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