随笔分类 - C#
C#
摘要:1.add reference,C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\8.0.11\ref\net8.0\PresentationCore.dll 2.Source code using System; usin
阅读全文
摘要:using System.Diagnostics; namespace ConsoleApp15 { internal class Program { static CancellationTokenSource cts { get; set; } static int idx = 0; stati
阅读全文
摘要://sp use mydb; CREATE PROCEDURE InsertIntoMtSpInStarEnd @StartId int =1, @EndId int =2021474638 AS BEGIN WHILE @StartId <= @EndId BEGIN DECLARE @Autho
阅读全文
摘要:Install-Package Newtonsoft.json static void ConvertXmlToJson(string xmlFile,string jsonFile) { try { if(File.Exists(xmlFile)) { using(FileStream fs=ne
阅读全文
摘要:using System.Diagnostics; using System.Xml; using System.Xml.Serialization; namespace ConsoleApp9 { internal class Program { static string xmlFile = "
阅读全文
摘要:using System.Runtime.InteropServices; namespace ConsoleApp6 { internal class Program { //copy from,https://gist.github.com/6rube/34b561827f0805f737425
阅读全文
摘要:1.Install SVG the third party software tool from nuget; 2. using System; using System.Collections.Generic; using System.Drawing.Imaging; using System.
阅读全文
摘要:using System.Security.Cryptography; using System.Text.Unicode; namespace ConsoleApp4 { internal class Program { static void Main(string[] args) { stri
阅读全文
摘要:namespace ConsoleApp4 { internal class Program { static void Main(string[] args) { string bigFile = @"C:\Users\fred\Downloads\ebook-master.zip"; ReadB
阅读全文
摘要:System.OutOfMemoryException HResult=0x8007000E Message=Exception of type 'System.OutOfMemoryException' was thrown. Source=mscorlib StackTrace: at Syst
阅读全文
摘要:using System.Collections.Concurrent; using System.Diagnostics; namespace ConsoleApp85 { internal class Program { static void Main(string[] args) { try
阅读全文
摘要:1. dotnet add package Pomelo.EntityFrameworkCore.MySql using Microsoft.EntityFrameworkCore; namespace ConsoleApp84 { internal class Program { static v
阅读全文
摘要:Managed Debugging Assistant 'ContextSwitchDeadlock' : 'The CLR has been unable to transition from COM context 0x28ab560 to COM context 0x28ab4a8 for 6
阅读全文
摘要:public DelCmd ExportAllCmd { get; set; } public DelCmd ExportAllBinaryFormatterCmd { get; set; } public DelCmd DeserializeJsonFileCmd { get; set; } pu
阅读全文
摘要:using System.Diagnostics; // See https://aka.ms/new-console-template for more information Console.WriteLine("Hello, World!"); string path= @"..\..\..\
阅读全文
摘要:Blob stands for binary large object byte[] bytesArr= (byte[])rows[i]["congest"]; bk.Congest = Encoding.UTF8.GetString(bytesArr) public static DataSet
阅读全文
摘要:namespace ConsoleApp59 { internal class Program { static string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly
阅读全文
摘要:Copy from https://www.erikzhou.com/blogs/reflection_in_csharp/ Pros and Cons of Reflection Reflection is a powerful tool, but it comes with its own se
阅读全文
摘要:using System.Diagnostics; using System.IO; using System.Reflection; using System.Text; namespace ConsoleApp58 { internal class Program { static List<B
阅读全文
摘要:using System.Threading; namespace ConsoleApp57 { internal class Program { static void Main(string[] args) { PrintNumers(); Console.WriteLine("Hello, W
阅读全文