原创 .Net Core API關於二維碼/圖片/Base64轉換的Help類

首先引入QRCoder Nuget包,方可使用。 using QRCoder; using System; using System.Collections.Generic; using System.Drawing; using

原创 .Net Core API自定義資源過濾器實現校驗請求頭是否要求

對於近來做的一個系統,要求訪問API的請求頭,必須傳System(系統)和Device(設備),且訪問值存在於定義的枚舉SystemEnum和DeviceEnum中,纔可訪問API。以下是實現代碼: using _SCscHero

原创 NVIDIA Geforce Experience安裝失敗完美解決方案

相信NVIDIA Geforce Experience安裝不上的夥伴大多數的原因都是電腦曾經安裝過NVIDIA Geforce Experience,但是再之後的安裝出現了安裝失敗。而不是其他原因導致裝不上(如:硬件未達到要求、驅

原创 Office·Word高級·VBA基礎概念語法

閱文時長 | 5.21分鐘 字數統計 | 1823字符 『Office·Word高級·VBA基礎概念語法』 編寫人 | SCscHero 編寫時間 | Monday, June 29, 2020 文章類型 |

原创 .Net Core API網站調用微信第三方API(實現微信授權登錄)

using _SCscHero.Base.Help; using _SCscHero.Model.System.Retrun; using Newtonsoft.Json; using System; using System.C

原创 如何打印博客文章的正文?

處理思路 通過一個JS命令,將不需要的部分Remove掉,把CSS調整一下。 打印示例 CSDN較爲固定,一般用來打印CSDN文章的方法如下: (function(){ $("#side").remove(); $("#comme

原创 .Net Core讀取配置文件的Help類

using Microsoft.Extensions.Configuration; using System; using System.Collections.Generic; using System.IO; using Sy

原创 C#有些對象使用點"."卻"."不出其屬性,但在快速監視中卻可以看到

之前想了一下,有可能有幾種原因造成這種情況。 訪問權限不夠,如:Private、Protected等。 匿名對象 父類擁有子類屬性 想了幾種解決辦法 轉成Dynamic、Object或者其它對象,還是不行。 使用反射的方式訪

原创 .Net Core報錯"'0x0A' is invalid within a JSON string. The string should be correctly "原因就是沒加引號

今天一個測試小姐姐測我的接口,發現了一個錯,乍一看還以爲是模型驗證的問題。實際上是她傳參的問題。一個參數少加了一個引號。 { “Message”: “‘0x0A’ is invalid within a JSON string.

原创 Carpa3平臺常用分頁方式

不分頁方法 • 數據綁定方式:1.構建數據綁定  2.數據庫查詢綁定 •問題:數據庫查詢後需要構建參數? • 可以是DataTable、IList<T>等列表結構的數據源。可以是業務構造,也可以來自DbHelper數據庫查詢 usi

原创 MVC中的Log4配置

首先,添加一個xml文件到mvc項目中,代碼如下: <?xml version="1.0" encoding="utf-8"?> <log4net> <!-- Define some output appenders -->

原创 .Net/C#中Http請求訪問Help類

using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.IO;

原创 .Net Core API常用自定義模型驗證特性

using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; na

原创 .Net Core API的一個Json轉換Help類

using Nancy.Json; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Data; namesp

原创 C#靜態類靜態方法中形參前的this關鍵字用法

public static class StringExtension { public static void Foo(this string s) { Console.WriteLine("Fo