随笔分类 -  C#

C#
摘要://Service namespace WebApplication4.Models { public class Book { public int Id { get; set; } public string Name { get; set; } public string ISBN { get 阅读全文
posted @ 2026-03-21 00:08 FredGrit 阅读(3) 评论(0) 推荐(0)
摘要://C# Server using System.Net; using System.Net.WebSockets; using System.Text; using System.Text.Json; namespace ConsoleApp7 { public class Program { s 阅读全文
posted @ 2026-03-18 23:59 FredGrit 阅读(3) 评论(0) 推荐(0)
摘要:#Server using System.Net; using System.Net.WebSockets; using System.Text; using System.Text.Json; namespace ConsoleApp7 { public class Program { stati 阅读全文
posted @ 2026-03-18 23:30 FredGrit 阅读(6) 评论(0) 推荐(0)
摘要:namespace ConsoleApp9 { internal class Program { static async Task Main(string[] args) { await PeriodicalTimerDemo(); } static async Task PeriodicalTi 阅读全文
posted @ 2026-03-18 23:01 FredGrit 阅读(4) 评论(0) 推荐(0)
摘要://Server: using System.Net; using System.Net.WebSockets; using System.Text; using System.Text.Json; namespace ConsoleApp7 { public class Program { sta 阅读全文
posted @ 2026-03-18 22:47 FredGrit 阅读(4) 评论(0) 推荐(0)
摘要:using Microsoft.AspNetCore.Mvc; using WebApplication3.Models; using WebApplication3.Services; namespace WebApplication3.Controllers { [ApiController] 阅读全文
posted @ 2026-03-17 23:08 FredGrit 阅读(2) 评论(0) 推荐(0)
摘要:Install-Package Swashbuckle.AspNetCore namespace WebApplication1.Models { public class Book { public int Id { get; set; } public string Name { get; se 阅读全文
posted @ 2026-03-15 00:01 FredGrit 阅读(6) 评论(0) 推荐(0)
摘要:using System.Collections; using System.Diagnostics; using System.Threading.Tasks; namespace ConsoleApp2 { internal class Program { static async Task M 阅读全文
posted @ 2026-03-09 21:06 FredGrit 阅读(6) 评论(0) 推荐(0)
摘要:Producer Install-Package Newtonsoft.Json Install-Package WebSocketSharp-netstandard using System; using System.Threading; using WebSocketSharp; using 阅读全文
posted @ 2026-02-09 18:07 FredGrit 阅读(9) 评论(0) 推荐(0)
摘要://WebAPI namespace BooksServices { public class Program { public static void Main(string[] args) { Console.WriteLine(DateTime.Now); var builder = WebA 阅读全文
posted @ 2025-12-05 00:21 FredGrit 阅读(9) 评论(0) 推荐(0)
摘要:1.New WebApi solution,add controller,BooksController namespace BooksServices.Models { public class Book { public int Id { get; set; } public string Na 阅读全文
posted @ 2025-12-04 23:48 FredGrit 阅读(7) 评论(0) 推荐(0)
摘要:Install-Package System.IO.Ports; //Sender.cs using System.IO.Ports; using System.Text; namespace ConsoleApp35 { internal class Program { static async 阅读全文
posted @ 2025-10-16 13:24 FredGrit 阅读(16) 评论(0) 推荐(0)
摘要:1.Download from https://sourceforge.net/projects/com0com/files/com0com/3.0.0/com0com-3.0.0.0-x64-fre.zip 2.Unzip 3.Run exe file and click as the defau 阅读全文
posted @ 2025-10-15 10:59 FredGrit 阅读(59) 评论(0) 推荐(0)
摘要:using System.Runtime.InteropServices; namespace ConsoleApp24 { internal class Program { [DllImport("user32.dll")] static extern bool SetProcessDPIAwar 阅读全文
posted @ 2025-10-12 16:55 FredGrit 阅读(10) 评论(0) 推荐(0)
摘要:Install-Package NUnit; Install-Package NUnit3TestAdapter; Install-Package Microsoft.Net.Test.Sdk; Install-Package Moq; using Moq; using NUnit.Framewor 阅读全文
posted @ 2025-10-12 14:33 FredGrit 阅读(9) 评论(0) 推荐(0)
摘要://Sender using System.Net.Sockets; using System.Security.AccessControl; namespace ConsoleApp18 { internal class Program { static async Task Main(strin 阅读全文
posted @ 2025-10-11 17:42 FredGrit 阅读(18) 评论(0) 推荐(0)
摘要://sender; class FileSender { private readonly HttpClient _httpClient; public FileSender() { _httpClient = new HttpClient { Timeout = TimeSpan.FromHour 阅读全文
posted @ 2025-10-11 14:10 FredGrit 阅读(11) 评论(0) 推荐(0)
摘要:Install-Package Mysql.Data; Install-Package Dapper; using Dapper; using MySql.Data.MySqlClient; using System.Data; using System.Diagnostics; namespace 阅读全文
posted @ 2025-10-08 21:30 FredGrit 阅读(10) 评论(0) 推荐(0)
摘要://Run PowerShell as Administrator role //Run below commands respectively //First command Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net 阅读全文
posted @ 2025-10-06 16:28 FredGrit 阅读(9) 评论(0) 推荐(0)
摘要:1. Platform Invocation (P/Invoke) Set C++ project as dll, compile, copy compiled c++ dll to C# bin/debug matched location //C++ // ConsoleApplication1 阅读全文
posted @ 2025-09-30 10:57 FredGrit 阅读(13) 评论(0) 推荐(0)