随笔分类 -  C#

摘要:程序里偶然用了System.IO.File.Create去创建文件,然后写入文件一直报错(文件被占用)。 解决办法 方案1 System.IO.File.Create(fileName).Close(); 方案2 using(System.IO.File.Create(fileName)) { // 阅读全文
posted @ 2022-06-22 16:12 六镇2012 阅读(753) 评论(0) 推荐(0)
摘要:参考:https://www.xp.cn/b.php/85332.html https://www.cnblogs.com/alexyuyu/archive/2010/05/09/1731070.html 全指令为:C:\Windows\Microsoft.NET\Framework\v4.0.30 阅读全文
posted @ 2022-05-27 17:17 六镇2012 阅读(171) 评论(0) 推荐(0)
摘要:1、引用NuGet.Packaging包,其中NuGet.Core已被弃用。 2、采用以下代码 ManifestMetadata metadata = new ManifestMetadata() { Authors = new[] { "Marc" }, Version = new NuGet.V 阅读全文
posted @ 2022-05-25 18:07 六镇2012 阅读(222) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/alayeshi/article/details/119002281 vs2019打开遇到“无法识别的GUID格式”错误,百度查到是注册表问题,定位到下列注册表位置。原注册表键值对为 key:C:\Program Files\Microsoft Visua 阅读全文
posted @ 2022-05-05 09:36 六镇2012 阅读(728) 评论(0) 推荐(0)
摘要:方案1: var response = await client.PostAsync(path, content); 方案2: var response = client.PostAsync(path, content).Result; 开发中采用HttpClient.PostAsync来执行pos 阅读全文
posted @ 2022-04-27 19:38 六镇2012 阅读(2263) 评论(0) 推荐(0)
摘要:问题背景: 某个c#程序需要已管理员权限启动,并且有开机启动的功能。 解决方案: 1、已管理员权限启动参考c#程序以管理员权限运行。 2、开机启动,参考代码 public static void SetAutoRun(bool isAutoRun) { //设置是否自动启动 if (isAutoRu 阅读全文
posted @ 2020-10-27 16:29 六镇2012 阅读(1572) 评论(1) 推荐(1)
摘要:通过自定义活动(Custom Action)卸载 https://blog.csdn.net/qq_20849387/article/details/78422081 https://blog.csdn.net/qq_20849387/article/details/78422432 https:/ 阅读全文
posted @ 2020-09-03 16:53 六镇2012 阅读(2449) 评论(0) 推荐(0)