随笔分类 -  CSharp

C#开发
摘要:// https://blog.csdn.net/Marzlam/article/details/118522068 // 初始化的时候读取配置 string a = builder.Configuration.GetConnectionString("odoo"); string b = buil 阅读全文
posted @ 2022-05-11 01:04 devs 阅读(921) 评论(0) 推荐(0) 编辑
摘要:C# 取消文件隐藏并恢复标准文件 DirectoryInfo di = new DirectoryInfo(@"D:\Software"); foreach (DirectoryInfo sub in di.GetDirectories()) { File.SetAttributes(sub.Ful 阅读全文
posted @ 2021-12-15 14:24 devs 阅读(210) 评论(0) 推荐(0) 编辑
摘要:在SQLite官网下载原始预编译包。 Precompiled Binaries for the .NET Standard 2.1 创建一个ASP.NET Core项目 项目添加预编译包解压缩后的引用 System.Data.SQLite.dll 随意代码 Con = new SQLiteConne 阅读全文
posted @ 2021-06-22 16:44 devs 阅读(544) 评论(0) 推荐(0) 编辑
摘要:using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { using (System.IO.StreamWriter writer = new System.IO.StreamWriter(ms, Encoding.GetE 阅读全文
posted @ 2021-05-25 18:27 devs 阅读(586) 评论(0) 推荐(0) 编辑
摘要:_is64Bit = Environment.Is64BitOperatingSystem; private object ReadRegistryKeyValue(string keyPath, string valueName) { object obj = null; using (var b 阅读全文
posted @ 2021-05-14 12:59 devs 阅读(162) 评论(0) 推荐(0) 编辑
摘要:System.Security.Cryptography.RSACryptoServiceProvider cryptoServiceProvider = new System.Security.Cryptography.RSACryptoServiceProvider(4096); Console 阅读全文
posted @ 2021-03-31 14:42 devs 阅读(403) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Automatic_Mouse_Click { internal static class En 阅读全文
posted @ 2021-03-15 11:57 devs 阅读(354) 评论(0) 推荐(0) 编辑
摘要:服务端 新建ASP.NET Core Web MVC 项目 SSOServer 2. NuGet安装IdentityServer4 3. 新建Config.cs类 public class Config { // scopes define the resources in your system 阅读全文
posted @ 2021-03-12 18:49 devs 阅读(382) 评论(0) 推荐(0) 编辑
摘要:案例 通过Aspose.Html.Converters.Converter.ConvertMarkdown将markdown转换为html 出现中文乱码的情况 解决办法 可以在转换之前,将内存流中的字符串改为UTF-8即可. Stream stream = new MemoryStream(Enco 阅读全文
posted @ 2021-03-10 12:09 devs 阅读(500) 评论(0) 推荐(0) 编辑
摘要:private void Main() { if (File.Exists(_svgFile)) { SetSvgSize(_svgFile, spnWidth.Value, spnHeight.Value); } } private void SetSvgSize(string file,deci 阅读全文
posted @ 2021-02-28 23:31 devs 阅读(443) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Text.RegularExpressions; public partial class RegexEx { /// <summary> /// 验证输入字符串是否与模式字符串匹配,匹配返回true /// </summary> /// <pa 阅读全文
posted @ 2021-02-28 23:24 devs 阅读(127) 评论(0) 推荐(0) 编辑
摘要:$"[Id] NOT IN ('{string.Join("','", data.Details.Select(q => q.Id.ToString()))}')" 阅读全文
posted @ 2021-02-28 23:21 devs 阅读(130) 评论(0) 推荐(0) 编辑
摘要:/// <summary> /// 不带[Serializable]标识的深度拷贝 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="obj"></param> /// <returns></returns> p 阅读全文
posted @ 2021-02-28 23:18 devs 阅读(98) 评论(0) 推荐(0) 编辑
摘要:public class Test { private static Random _rd = new Random(); public Guid Id { get; set; } public string Name { get; set; } public bool Check { get; s 阅读全文
posted @ 2020-10-26 14:14 devs 阅读(269) 评论(0) 推荐(0) 编辑
摘要:I am using VS 2012 and it was working all fine until I started observing some funny behavior. When I open my code it shows red Underlines which we usu 阅读全文
posted @ 2020-10-14 10:15 devs 阅读(1817) 评论(0) 推荐(0) 编辑