随笔分类 - CSharp
C#开发
摘要:// https://blog.csdn.net/Marzlam/article/details/118522068 // 初始化的时候读取配置 string a = builder.Configuration.GetConnectionString("odoo"); string b = buil
阅读全文
摘要:C# 取消文件隐藏并恢复标准文件 DirectoryInfo di = new DirectoryInfo(@"D:\Software"); foreach (DirectoryInfo sub in di.GetDirectories()) { File.SetAttributes(sub.Ful
阅读全文
摘要:在SQLite官网下载原始预编译包。 Precompiled Binaries for the .NET Standard 2.1 创建一个ASP.NET Core项目 项目添加预编译包解压缩后的引用 System.Data.SQLite.dll 随意代码 Con = new SQLiteConne
阅读全文
摘要:using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { using (System.IO.StreamWriter writer = new System.IO.StreamWriter(ms, Encoding.GetE
阅读全文
摘要:_is64Bit = Environment.Is64BitOperatingSystem; private object ReadRegistryKeyValue(string keyPath, string valueName) { object obj = null; using (var b
阅读全文
摘要:System.Security.Cryptography.RSACryptoServiceProvider cryptoServiceProvider = new System.Security.Cryptography.RSACryptoServiceProvider(4096); Console
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Automatic_Mouse_Click { internal static class En
阅读全文
摘要:服务端 新建ASP.NET Core Web MVC 项目 SSOServer 2. NuGet安装IdentityServer4 3. 新建Config.cs类 public class Config { // scopes define the resources in your system
阅读全文
摘要:案例 通过Aspose.Html.Converters.Converter.ConvertMarkdown将markdown转换为html 出现中文乱码的情况 解决办法 可以在转换之前,将内存流中的字符串改为UTF-8即可. Stream stream = new MemoryStream(Enco
阅读全文
摘要:private void Main() { if (File.Exists(_svgFile)) { SetSvgSize(_svgFile, spnWidth.Value, spnHeight.Value); } } private void SetSvgSize(string file,deci
阅读全文
摘要:using System; using System.Text.RegularExpressions; public partial class RegexEx { /// <summary> /// 验证输入字符串是否与模式字符串匹配,匹配返回true /// </summary> /// <pa
阅读全文
摘要:$"[Id] NOT IN ('{string.Join("','", data.Details.Select(q => q.Id.ToString()))}')"
阅读全文
摘要:/// <summary> /// 不带[Serializable]标识的深度拷贝 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="obj"></param> /// <returns></returns> p
阅读全文
摘要:public class Test { private static Random _rd = new Random(); public Guid Id { get; set; } public string Name { get; set; } public bool Check { get; s
阅读全文
摘要: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
阅读全文