随笔分类 - 【dotnet】
【dotnet】啥?这家伙写gRpc 居然没有proto文件
摘要:使用 .NET 的代码优先 gRPC 服务和客户端 当整个系统使用 .NET 时,代码优先是一个不错的选择: 可以在 .NET 服务器和客户端之间共享 .NET 服务和数据协定类型。 无需在 .proto 文件和代码生成过程中定义协定。 不建议在具有多种语言的 polyglot 系统中使用代码优先。
阅读全文
【dotnet】 TxtHelper
摘要:public static class TxtHelper { /// <summary> /// 在txt文件中加一条数据 /// </summary> /// <param name="folderName">文件夹名称</param> /// <param name="fileName">文件
阅读全文
【dotnet】程序集注入
摘要:/// <summary> /// IServiceCollection扩展 /// </summary> public static class ServiceExtension { /// <summary> /// 用DI批量注入接口程序集中对应的实现类。 /// <para> /// 需要注
阅读全文
【.net】API 下载文件
摘要:Core: public ActionResult Get(string id) { HttpResponseMessage result = null; DirectoryInfo directoryInfo = new DirectoryInfo(@"D:\pic"); FileInfo fou
阅读全文
【Linux】使用Nginx发布dotnet的网站
摘要:1.安装Nginx【自行百度】 2.安装dotnet运行时【自行百度】 3.配置Nginx—— /etc/nginx/conf.d/default.conf server { listen 80; server_name localhost; location / { proxy_pass http
阅读全文