目录 关于数据绑定 视图-视图绑定 绑定模式 简单的集合绑定 C# Xamarin 数据绑定入门基础 关于数据绑定 Xamarin 单向、双向绑定 Xaml绑定 C#代码绑定 在此之前,几段 伪代码 帮助像我一样菜的同学入门。。。 假如说,有两个控件,一个是滑动条(Slider),一个是显示文本的标签(Label)。 Slider slider = new Slider() { Maximum = 1,[......]继续阅读
目录 关于数据绑定 视图-视图绑定 绑定模式 简单的集合绑定 C# Xamarin 数据绑定入门基础 关于数据绑定 Xamarin 单向、双向绑定 Xaml绑定 C#代码绑定 在此之前,几段 伪代码 帮助像我一样菜的同学入门。。。 假如说,有两个控件,一个是滑动条(Slider),一个是显示文本的标签(Label)。 Slider slider = new Slider() { Maximum = 1,[......]继续阅读
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,…
目录 一,授权认证 二,请求类型 三,数据传输 C# HttpClient 请求认证、数据传输笔记 一,授权认证 客户端请求服务器时,需要通过授权认证许可,方能获取服务器资源,目前比较常见的认证方式有 Basic 、JWT、Cookie。 HttpClient 是 C# 中的 HTTP/HTTPS 客户端,用于发送 HTTP 请求和接收来自通过 URI 确认的资源的 HTTP 响应。下面以具体代码做示范。 1. 基础认证示例 // Basic基础认证 public async Task Basi[......]继续…
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…
表达式树练习实践:C#值类型、引用类型、泛型、集合、调用函数 [TOC] 一,定义变量 C# 表达式树中,定义一个变量,使用 ParameterExpression。 创建变量结点的方法有两种, Expression.Parameter() Expression.Variable() // 另外,定义一个常量可以使用 Expression.Constant()。 两种方式都是生成 ParameterExpression 类型 Parameter() 和 Variable() 都具有两个重载。他们创建一个 Param…
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…
表达式树练习实践:入门基础 [TOC] 什么是表达式树 来自微软官方文档的定义: 表达式树以树形数据结构表示代码。 它能干什么呢? 你可以对表达式树中的代码进行编辑和运算。 这样能够动态修改可执行代码、在不同数据库中执行 LINQ 查询以及创建动态查询。 好不好玩? 表达式树还能用于动态语言运行时 (DLR) 以提供动态语言和 .NET Framework 之间的互操作性,同时保证编译器编写员能够发射表达式树而非 Microsoft 中间语言 (MSIL)。 哪里有应用? ORM框架、工作流框架等,使用到 Lamb…
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…
表达式树练习实践:C# 循环 [TOC] C# 提供了以下几种循环类型。 循环类型 描述 while 循环 当给定条件为真时,重复语句或语句组。它会在执行循环主体之前测试条件。 for/foreach 循环 多次执行一个语句序列,简化管理循环变量的代码。 do...while 循环 除了它是在循环主体结尾测试条件外,其他与 while 语句类似。 嵌套循环 您可以在 while、for 或 do..while 循环内使用一个或多个循环。 当然,还有以下用于控制循环的语句 控制语句 描述 break 语句 终止 lo…
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 …
表达式树练习实践:C#判断语句 [TOC] 判断语句 C# 提供了以下类型的判断语句: 语句 描述 if 一个 if 语句 由一个布尔表达式后跟一个或多个语句组成。 if...else 一个 if 语句 后可跟一个可选的 else 语句,else 语句在布尔表达式为假时执行。 嵌套 if 语句 您可以在一个 if 或 else if 语句内使用另一个 if 或 else if 语句。 switch 语句 一个 switch 语句允许测试一个变量等于多个值时的情况。 嵌套 switch 语 您可以在一个 switch…
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 …
表达式树练习实践:C# 运算符 [TOC] 在 C# 中,算术运算符,有以下类型 算术运算符 关系运算符 逻辑运算符 位运算符 赋值运算符 其他运算符 这些运算符根据参数的多少,可以分作一元运算符、二元运算符、三元运算符。本文将围绕这些运算符,演示如何使用表达式树进行操作。 对于一元运算符和二元运算符的 Expression 的子类型如下: UnaryExpression; //一元运算表达式 BinaryExpression; //二元运算表达式 一,算术运算符 运算符 描述 + 把两个操作数相加 - 从第一个操…
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…
表达式树练习实践:变量、常量与赋值 定义变量 ParameterExpression 用来创建变量、变量参数表达式。 在 C# 中,变量分为以下几种类型: 值类型(Value types) 引用类型(Reference types) 指针类型(Pointer types) 一般上,只用到值类型和引用类型,这里不会说到指针类型。 C#的基本值类型有:bool、byte、char、double、float、int、long等(C#中,数组属于引用类型)。 表达式树创建一个有两种方式变量: ParameterExpres…
[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…
[TOC] 首先我要说明,我失败了~ 我把我的进度和经验放出来,希望能够帮助别人完成编译工作~ 背景:最近接手一个华为某型号的嵌入式设备,需要在上面搭建 .NET Core 环境。 设备是 Armel 架构的,Linux 内核 3.10;.NET Core ARM 只有 Armhf。 因此编译出来的二进制文件无法在此设备下运行。 然后想尝试在 Git 上下载源码,手动编译出 Armel 版本的 .NET Core SDK/Runtime。 感谢张队提供了大量的参考资料。 一,工作开始前 .NET Core SDK/…
CZGL.Auth Found a bug that only allows one user to log in at a time, without the ability for multiple users to log in simultaneously. Hahahahahahahahahahahahahahahahahahahahaha. I plan to optimize it properly, fix the bug over the weekend, and do some testing …
CZGL.Auth 发现有Bug,会导致只能有一个用户登录,无法多个用户同时登录。 哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈。 打算好好优化一下,周六周日修改Bug,做好测试再放出来,哈哈哈哈哈哈哈哈哈哈哈哈哈。 新版本开源地址:https://github.com/whuanle/CZGL.Auth 我的代码太渣了,大佬们指点一下。 CZGL.Auth 是一个基于 Jwt 实现的快速角色授权库,ASP.Net Core 的 Identity 默认的授权是 Cookie。而 Jwt 授权只提供了基础实现和接口,需要自…
[TOC] ① Store API Accessible by Roles/Users For example, Use List<ApiPermission> to store the authorized API list for the role. Optional. Authorized APIs can also be stored in the Token, which can solely contain role information and user identity informa…