上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 44 下一页
摘要: 提问 如何写一个go的HelloWorld 回答 有几个注意点 package package main main包才能有运行main方法 引用 import ( "fmt" "sort" ) main函数 func main() { fmt.Println("HelloWorld") } 运行 g 阅读全文
posted @ 2022-11-01 16:07 喜爱糖葫芦 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 提问 如何切面记录日志 回答 使用MethodDecorator.Fody using System.Reflection; using my.Attributes; using my.Log4Net; using log4net; using MethodDecorator.Fody.Interf 阅读全文
posted @ 2022-11-01 14:43 喜爱糖葫芦 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 提问 如何获取当前程序集 回答 var assembly = Assembly.GetExecutingAssembly(); 阅读全文
posted @ 2022-11-01 09:29 喜爱糖葫芦 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 提问 如何写出最优美的工厂模式 回答 首先定义什么是最优美 最优美代表着他:面对新增开放,面对修改关闭实践 那么如何实现呢? 我选择使用特性 + 反射 public ICommand? BuildCommand(string[]? args) { if (args == null || args.L 阅读全文
posted @ 2022-11-01 09:28 喜爱糖葫芦 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 提问 异步任务如何同步阻塞 回答 我选择使用GetAwaiter().GetResult() 他比直接调用.Result的兼容性更好因为它支持Task返回类型; 阅读全文
posted @ 2022-10-28 17:24 喜爱糖葫芦 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 提问 如何删除带有内容的文件夹 回答 if (Directory.Exists(dir)) Directory.Delete(dir, true); 阅读全文
posted @ 2022-10-28 14:16 喜爱糖葫芦 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 提问 如何读取被占用文件内容 解答 public override (bool ok, string msg) Excute() { var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"Logs\Info\{DateTi 阅读全文
posted @ 2022-10-28 14:15 喜爱糖葫芦 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 提问 什么是语义化版本 回答 主版本.次版本.修正版本 主版本变更条件:不兼容的修改加入 次版本变更条件:在有向下兼容的新功能出现时递增 修正版本变更条件:只做了向下兼容的修正时才递增 参考 https://semver.org/lang/zh-CN/ 阅读全文
posted @ 2022-10-20 16:03 喜爱糖葫芦 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 提问 软件授权专业词汇 回答 License:许可证 Entitlements:授权 购买授权后颁发许可 阅读全文
posted @ 2022-10-20 11:20 喜爱糖葫芦 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 提问 构建后事件如何判断文件是否存在 回答 cd bin/Debug if exist *.nupkg dotnet nuget push *.nupkg --api-key oy2agil73bnrazxeblmqs2msoyoam7cuxh6ysybqn3zuzm --source https: 阅读全文
posted @ 2022-10-19 17:13 喜爱糖葫芦 阅读(89) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 44 下一页