posts - 609,  comments - 13,  views - 64万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  .NET

1 2 3 4 5 ··· 7 下一页
C#获取设备型号
摘要:来源百度AI回答1. Windows系统在Windows系统上,你可以使用SystemInformation类(属于System.Windows.Forms命名空间)来获取一些基本的设备信息,例如制造商、型号等。但是,请注意,这种方法可能不会提供所有设备的详细型号信息。 using System; 阅读全文
posted @ 2025-02-14 13:14 邢帅杰 阅读(7) 评论(0) 推荐(0) 编辑
前端运行exe、bat
摘要:使用Cjwdev.WindowsApi /// <summary> /// 执行BAT(前端) /// 创建一个进程,并以指定的会话身份运行一个应用程序或命令。 /// 这对于需要模拟用户上下文或在特定权限下执行操作的应用程序特别有用。 /// </summary> /// <param name= 阅读全文
posted @ 2025-01-22 13:45 邢帅杰 阅读(7) 评论(0) 推荐(0) 编辑
.NET使用Socket服务端和客户端代码示例
摘要:服务端 using System; using System.Collections.Generic; using System.Net.Sockets; using System.Net; using System.Text; namespace XCGConsoleApp { internal 阅读全文
posted @ 2025-01-06 15:32 邢帅杰 阅读(32) 评论(0) 推荐(0) 编辑
powershell命令判断端口是否通畅,不使用telnet ip port,cmd命令行查看所有端口的占用情况,cmd解除端口占用
摘要:打开 PowerShell 命令行界面(按下 Win+R,输入“powershel”,然后按回车键),输入 Test-NetConnection -ComputerName <主机名或IP地址> -Port <端口号>示例:Test-NetConnection -ComputerName local 阅读全文
posted @ 2024-12-26 14:42 邢帅杰 阅读(185) 评论(0) 推荐(0) 编辑
.net动态类ExpandoObject及使用场景
摘要:它位于 System.Dynamic 命名空间中。与普通的 C# 类型不同,ExpandoObject 允许在运行时动态地添加、删除或修改其成员(属性或方法)。这使得它在一些需要高度灵活性和动态性的数据结构场景中非常有用。ExpandoObject 的基本特性动态成员访问:可以在运行时添加或移除属性 阅读全文
posted @ 2024-11-13 16:26 邢帅杰 阅读(181) 评论(0) 推荐(0) 编辑
ContentType介绍
摘要:参考:https://blog.csdn.net/ws9029/article/details/112326479当处理HTTP请求时,Content-Type头部字段用于指定请求或响应的数据类型。以下是几种常见的Content-Type。text/html:HTML文档类型。application 阅读全文
posted @ 2024-11-07 18:02 邢帅杰 阅读(35) 评论(0) 推荐(0) 编辑
.net网页验证码、登录验证码
摘要:来源:https://blog.csdn.net/Yuhang_Zhou/article/details/140614304验证码辅助类 using System.Drawing; using System.Drawing.Imaging; namespace XCGApp { /// <summa 阅读全文
posted @ 2024-11-07 17:47 邢帅杰 阅读(34) 评论(0) 推荐(0) 编辑
.net文件转Base64
摘要:看 public class FileUtil { /// <summary> /// 文件转换成Base64字符串 /// </summary> /// <param name="fileName">文件绝对路径</param> /// <returns></returns> public sta 阅读全文
posted @ 2024-11-06 09:33 邢帅杰 阅读(30) 评论(0) 推荐(0) 编辑
The instance of entity type 'xxx' cannot be tracked because another instance with the same key value for {'xxx'} is already being tracked.
摘要:参考:https://blog.csdn.net/qq_18638761/article/details/107833999https://www.cnblogs.com/stgp/p/12294454.html发生的原因,在CheckProductionCode()方法中根据主键id查询对象时没有 阅读全文
posted @ 2024-10-16 13:55 邢帅杰 阅读(34) 评论(0) 推荐(0) 编辑
.NET压缩zip、.NET解压zip
摘要:参考:https://blog.csdn.net/zhaotianff/article/details/141156035 using System.IO.Compression; namespace XCG.Commons { public class ZipUtil { /// <summary 阅读全文
posted @ 2024-10-14 10:04 邢帅杰 阅读(21) 评论(0) 推荐(0) 编辑
C#执行cmd命令
摘要:private async void btnInstallPackage_Click(object sender, EventArgs e) { string msg = await Task.Run(() => { return executeCmd(); }); UpdateMsg(msg); 阅读全文
posted @ 2024-10-09 14:26 邢帅杰 阅读(20) 评论(0) 推荐(0) 编辑
.net删除目录以及目录内所有文件
摘要:看 using System.IO; public static void DeleteDirectory(string targetDir) { string[] files = Directory.GetFiles(targetDir); string[] dirs = Directory.Ge 阅读全文
posted @ 2024-05-17 11:12 邢帅杰 阅读(135) 评论(0) 推荐(0) 编辑
.net xml序列化与xml反序列化
摘要:序列化 string xmlStr = ""; var dto = new ReqDto() { ErrorCode = 200, ReqName = "test" }; XmlSerializer serializer = new XmlSerializer(typeof(ReqDto)); us 阅读全文
posted @ 2024-04-08 15:07 邢帅杰 阅读(18) 评论(0) 推荐(0) 编辑
dos命令安装证书
摘要:dos命令安装证书在Windows操作系统中,可以使用certutil命令来安装证书。以下是使用certutil安装证书的基本步骤和示例代码:打开命令提示符(以管理员身份运行)。使用certutil命令和-addstore选项来将证书添加到存储中。示例代码:certutil -addstore ro 阅读全文
posted @ 2024-03-19 10:09 邢帅杰 阅读(234) 评论(0) 推荐(0) 编辑
Http请求头 application/xml和text/xml
摘要:Accept:指定客户端能够接收的内容类型,内容类型中的先后次序表示客户端接收的先后次序。 实例:Accept:text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*; 阅读全文
posted @ 2024-03-12 10:09 邢帅杰 阅读(502) 评论(0) 推荐(0) 编辑
.net api接口接收字符串或者xml,.NET发送xml请求
摘要:看 using System.Xml.Serialization; using Microsoft.AspNetCore.Mvc; using XCGWebApp.Dtos; using XCGWebApp.Common; using System.Text; namespace XCGWebApp 阅读全文
posted @ 2024-03-08 15:39 邢帅杰 阅读(342) 评论(0) 推荐(0) 编辑
.net8连接MySQL、连接MySQL显示SSL Authentication Error错误处理
摘要:参考.net6连接mysql:https://www.cnblogs.com/xsj1989/p/15379350.html其中.net8版本的不能安装:MySql.EntityFrameworkCore这个包,需要安装Pomelo.EntityFrameworkCore.MySql,而且版本号必须 阅读全文
posted @ 2023-12-29 17:15 邢帅杰 阅读(384) 评论(0) 推荐(0) 编辑
VS运行网站报错Failed to register URL "http://localhost:5718/" for site
摘要:很多都说是端口被占用,的确有可能,但大部分不是这样管理员运行cmd(命令提示符),执行命令: net stop winnatnet start winnat 阅读全文
posted @ 2023-10-11 10:43 邢帅杰 阅读(323) 评论(0) 推荐(0) 编辑
DES加密解密
摘要:来源:https://blog.csdn.net/Zhangchen9091/article/details/46278463https://blog.51cto.com/cbcw/6289416 using System; using System.IO; using System.Securit 阅读全文
posted @ 2023-10-09 15:46 邢帅杰 阅读(34) 评论(0) 推荐(0) 编辑
.net core websocket
摘要:来源:https://blog.csdn.net/i2blue/article/details/125288034Program.cs #region WebSockets // https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/w 阅读全文
posted @ 2023-04-12 10:45 邢帅杰 阅读(284) 评论(0) 推荐(1) 编辑

1 2 3 4 5 ··· 7 下一页
点击右上角即可分享
微信分享提示