[TOC] Description ASP.NET Core 3.0 is a lightweight JWT role/user authentication library controlled by a single API. Recently, I had some spare time to redo a role authorization library. The previous library I developed relied on Microsoft's default interfaces…

2019年12月15日 0条评论 2768点热度 0人点赞 痴者工良 阅读全文

[TOC] 说明 ASP.NET Core 3.0 一个 jwt 的轻量角色/用户、单个API控制的授权认证库 最近得空,重新做一个角色授权库,而之前做了一个角色授权库,是利用微软的默认接口做的,查阅了很多文档,因为理解不够,所以最终做出了有问题。 之前的旧版本 https://github.com/whuanle/CZGL.Auth/tree/1.0.0 如果要使用微软的默认接口,我个人认为过于繁杂,而且对于这部分的资料较少。。。 使用默认接口实现授权认证,可以参考我另一篇文章 ASP.NET Core 使用 J…

2019年12月15日 0条评论 2746点热度 0人点赞 痴者工良 阅读全文

C# Xamarin Data Binding Basics [TOC] About Data Binding Xamarin One-way and Two-way Binding Xaml Binding C# Code Binding Before diving deeper, here are some pseudocode snippets to help beginners like myself get started... Suppose we have two controls: a Slider…

2019年12月15日 0条评论 64点热度 0人点赞 痴者工良 阅读全文

目录 关于数据绑定 视图-视图绑定 绑定模式 简单的集合绑定 C# Xamarin 数据绑定入门基础 关于数据绑定 Xamarin 单向、双向绑定 Xaml绑定 C#代码绑定 在此之前,几段 伪代码 帮助像我一样菜的同学入门。。。 假如说,有两个控件,一个是滑动条(Slider),一个是显示文本的标签(Label)。 Slider slider = new Slider() { Maximum = 1,[......]继续阅读

2019年12月15日 0条评论 2796点热度 0人点赞 痴者工良 阅读全文

C# HttpClient Request Authentication and Data Transmission Notes [TOC] I. Authorization Authentication When a client requests a server, authorization authentication is required to obtain server resources. Currently, common authentication methods include Basic,…

2019年12月15日 0条评论 136点热度 0人点赞 痴者工良 阅读全文

目录 一,授权认证 二,请求类型 三,数据传输 C# HttpClient 请求认证、数据传输笔记 一,授权认证 客户端请求服务器时,需要通过授权认证许可,方能获取服务器资源,目前比较常见的认证方式有 Basic 、JWT、Cookie。 HttpClient 是 C# 中的 HTTP/HTTPS 客户端,用于发送 HTTP 请求和接收来自通过 URI 确认的资源的 HTTP 响应。下面以具体代码做示范。 1. 基础认证示例 // Basic基础认证 public async Task Basi[......]继续…

2019年12月15日 0条评论 2839点热度 0人点赞 痴者工良 阅读全文

Expression Tree Practical Exercises: C# Value Types, Reference Types, Generics, Collections, Function Calls [TOC] 1. Defining Variables In C# expression trees, to define a variable, use ParameterExpression. There are two ways to create variable nodes: Expressi…

2019年12月15日 1条评论 102点热度 0人点赞 痴者工良 阅读全文

表达式树练习实践:C#值类型、引用类型、泛型、集合、调用函数 [TOC] 一,定义变量 C# 表达式树中,定义一个变量,使用 ParameterExpression。 创建变量结点的方法有两种, Expression.Parameter() Expression.Variable() // 另外,定义一个常量可以使用 Expression.Constant()。 两种方式都是生成 ParameterExpression 类型 Parameter() 和 Variable() 都具有两个重载。他们创建一个 Param…

2019年12月15日 1条评论 2655点热度 0人点赞 痴者工良 阅读全文

Expression Tree Practice: Getting Started [TOC] What is an Expression Tree Definition from Microsoft Official Documentation: An expression tree represents code as a tree data structure. What can it do? You can edit and compute code in the expression tree. This…

2019年12月15日 3条评论 112点热度 0人点赞 痴者工良 阅读全文

表达式树练习实践:入门基础 [TOC] 什么是表达式树 来自微软官方文档的定义: 表达式树以树形数据结构表示代码。 它能干什么呢? 你可以对表达式树中的代码进行编辑和运算。 这样能够动态修改可执行代码、在不同数据库中执行 LINQ 查询以及创建动态查询。 好不好玩? 表达式树还能用于动态语言运行时 (DLR) 以提供动态语言和 .NET Framework 之间的互操作性,同时保证编译器编写员能够发射表达式树而非 Microsoft 中间语言 (MSIL)。 哪里有应用? ORM框架、工作流框架等,使用到 Lamb…

2019年12月15日 3条评论 3383点热度 0人点赞 痴者工良 阅读全文

Expression Tree Practice: C# Loops [TOC] C# provides several types of loops. Loop Type Description while Loop Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body. for/foreach Loop Ex…

2019年12月15日 1条评论 2903点热度 0人点赞 痴者工良 阅读全文

表达式树练习实践:C# 循环 [TOC] C# 提供了以下几种循环类型。 循环类型 描述 while 循环 当给定条件为真时,重复语句或语句组。它会在执行循环主体之前测试条件。 for/foreach 循环 多次执行一个语句序列,简化管理循环变量的代码。 do...while 循环 除了它是在循环主体结尾测试条件外,其他与 while 语句类似。 嵌套循环 您可以在 while、for 或 do..while 循环内使用一个或多个循环。 当然,还有以下用于控制循环的语句 控制语句 描述 break 语句 终止 lo…

2019年12月15日 1条评论 2853点热度 0人点赞 痴者工良 阅读全文

Expression Tree Practice: C# Conditional Statements [TOC] Conditional Statements C# provides the following types of conditional statements: Statement Description if An if statement consists of a boolean expression followed by one or more statements. if...else …

2019年12月15日 4条评论 3708点热度 0人点赞 痴者工良 阅读全文

表达式树练习实践:C#判断语句 [TOC] 判断语句 C# 提供了以下类型的判断语句: 语句 描述 if 一个 if 语句 由一个布尔表达式后跟一个或多个语句组成。 if...else 一个 if 语句 后可跟一个可选的 else 语句,else 语句在布尔表达式为假时执行。 嵌套 if 语句 您可以在一个 if 或 else if 语句内使用另一个 if 或 else if 语句。 switch 语句 一个 switch 语句允许测试一个变量等于多个值时的情况。 嵌套 switch 语 您可以在一个 switch…

2019年12月15日 4条评论 3652点热度 0人点赞 痴者工良 阅读全文

Expression Tree Practice: C# Operators [TOC] In C#, the arithmetic operators can be categorized into the following types: Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Other Operators These operators can be …

2019年12月15日 1条评论 116点热度 0人点赞 痴者工良 阅读全文

表达式树练习实践:C# 运算符 [TOC] 在 C# 中,算术运算符,有以下类型 算术运算符 关系运算符 逻辑运算符 位运算符 赋值运算符 其他运算符 这些运算符根据参数的多少,可以分作一元运算符、二元运算符、三元运算符。本文将围绕这些运算符,演示如何使用表达式树进行操作。 对于一元运算符和二元运算符的 Expression 的子类型如下: UnaryExpression; //一元运算表达式 BinaryExpression; //二元运算表达式 一,算术运算符 运算符 描述 + 把两个操作数相加 - 从第一个操…

2019年12月15日 1条评论 3059点热度 0人点赞 痴者工良 阅读全文

Expression Tree Practice: Variables, Constants, and Assignments Defining Variables ParameterExpression is used to create variables and variable parameter expressions. In C#, variables are divided into the following types: Value types Reference types Pointer ty…

2019年12月15日 0条评论 3049点热度 0人点赞 痴者工良 阅读全文

表达式树练习实践:变量、常量与赋值 定义变量 ParameterExpression 用来创建变量、变量参数表达式。 在 C# 中,变量分为以下几种类型: 值类型(Value types) 引用类型(Reference types) 指针类型(Pointer types) 一般上,只用到值类型和引用类型,这里不会说到指针类型。 C#的基本值类型有:bool、byte、char、double、float、int、long等(C#中,数组属于引用类型)。 表达式树创建一个有两种方式变量: ParameterExpres…

2019年12月15日 0条评论 3011点热度 0人点赞 痴者工良 阅读全文

[TOC] First of all, I want to state that I have failed~ I am sharing my progress and experience in the hope of helping others complete the compilation work~ Background: Recently, I took over an embedded device of a certain model from Huawei, which requires set…

2019年12月15日 3条评论 3778点热度 1人点赞 痴者工良 阅读全文

[TOC] 首先我要说明,我失败了~ 我把我的进度和经验放出来,希望能够帮助别人完成编译工作~ 背景:最近接手一个华为某型号的嵌入式设备,需要在上面搭建 .NET Core 环境。 设备是 Armel 架构的,Linux 内核 3.10;.NET Core ARM 只有 Armhf。 因此编译出来的二进制文件无法在此设备下运行。 然后想尝试在 Git 上下载源码,手动编译出 Armel 版本的 .NET Core SDK/Runtime。 感谢张队提供了大量的参考资料。 一,工作开始前 .NET Core SDK/…

2019年12月15日 3条评论 3734点热度 1人点赞 痴者工良 阅读全文
1394041424354