• 2024-07-04在SelfHost项目中获取客户端IP地址
    在SelfHost项目中,获取客户端的IP地址比OwinSelfHost项目要复杂一些,可以通过以下方法获得:base.Request.Properties["System.ServiceModel.Channels.RemoteEndpointMessageProperty"].Address创建一个SelfHost项目的大概过程:创建名称为SelfHostSample的Windows窗体应用(.NETF
  • 2024-07-04在OwinSelfHost项目中获取客户端IP地址
    在OwinSelfHost项目中,获取客户端的IP地址可以通过以下方法获得:base.Request.GetOwinContext().Request.RemoteIpAddress创建一个OwinSelfHost项目的大概过程:创建名称为OwinSelfHostSample的Windows窗体应用(.NETFramework)项目;在NuGet包管理器中添加中添加Microsoft.AspNe
  • 2024-07-04题目-计算是周几
    #include<bits/stdc++.h>usingnamespacestd;intmain(){inta,b,c=1;cin>>a>>b;for(inti=1;i<=b;i++){c*=a;c%=7;}if(c==0){cout<<"Sunday";}
  • 2024-07-04WPF Datagrid ContextMenu MenuItem Command CommandParameter MultiBinding
     //xaml<Windowx:Class="WpfApp194.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas
  • 2024-07-04AtCoder Beginner Contest 043
    D-Unbalanced只需要找到形如\(XX\)、\(XYX\)的字串即可。即两个相同字符之间最多间隔一个字符。证明:若不然,\(AXYA\),每加一个字符\(A\),都要增加多余字符\(XY\),不可能符合要求。#include<bits/stdc++.h>usingnamespacestd;usingi64=longlong;intmain(){ ios
  • 2024-07-04用C++解决编程题目:求特殊自然数
    学习目标:用C++编写简单的程序学习内容:#include<iostream>usingnamespacestd;intmain(){ inta,b,c; for(a=1;a<7;a++){ for(b=0;b<7;b++){ for(c=1;c<7;c++){ if(a*7*7+b*7+c==c*9*9+b*9+a){ cout<<a*7*7+b*7+c<<endl; cout<
  • 2024-07-04Pgsql帮助类 netcore
    十年河东,十年河西,莫欺少年穷学无止境。精益求精usingNpgsql;usingSystem;usingNpgsqlTypes;usingSystem.Data;usingSystem.Collections.Generic;usingSystem.Reflection;usingSystem.Configuration;usingswapCommon;namespacePgSqlHelper{publiccla
  • 2024-07-03WPF AllowsTransparency DragMove
     //xaml<Windowx:Class="WpfApp191.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas
  • 2024-07-03WPF open image and print as pdf file
    //xaml<Windowx:Class="WpfApp189.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi
  • 2024-07-03WPF OpenFielDialog Filter InitialiaDirectory Title
    //xaml<Windowx:Class="WpfApp189.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi
  • 2024-07-03Winform数据绑定基类
    usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Linq;usingSystem.Runtime.CompilerServices;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;usingSystem.Threading;publicabstractclassB
  • 2024-07-03使用EF 连接 数据库 SQLserver、MySql 实现 CodeFirst
    1.新建项目,下载Nuget安装包创建项目需要注意几点,如果是基于.netframework的项目需要选择相应版本的EF,如果是跨平台则选择EFCore版本。我这里选择的是.netframework版本。红框里面是实现EFCodeFirst需要的包。对应的版本:EntityFramework6.3.0MySql.Data6.8
  • 2024-07-03C#.NET FRAMEWORK .NET CORE .NET6 .NET8 判断是否Emoji
    C#.NETFRAMEWORK.NETCORE.NET6.NET8判断是否Emoji 工具类:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;namespaceConsoleThreadTimer{publicclassEmojiUtil{///<s
  • 2024-07-02WPF Image scalertransform translatetransform mvvm,custom delegate command CommandManager.RequerySugg
    //xaml<Windowx:Class="WpfApp187.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.mi
  • 2024-07-02华为OCR 腾讯OCR 百度OCR 三家各分秋色 第一当属华为
    当提及华为OCR的应用场景时,这些是常见的使用案例:金融行业:在银行和金融机构中,华为OCR技术广泛用于身份证件识别、银行卡识别和票据识别。这些功能可以用于客户身份验证、快速开户以及自动化的支付处理。政府服务:政府部门利用华为OCR技术进行公民身份证识别、驾驶证和车牌识
  • 2024-07-02数位dp
    数位dp学习笔记用途:用来解决与数位有关而与数字的值无关或没有太大关系的一类问题。特征:统计满足一定条件的数的数量条件转化后可以用数位(数位,指一个数中每一个数字所占的位置)理解判断数字范围有限制且很大,暴力验证超时有一个模板,\(come\quadfrom\)一位大佬Mathiso
  • 2024-07-02(对结果分类讨论)牛客周赛 Round 1 C.游游的交换字符
    题意:思路:观察发现相邻元素不同的结果只有两种,要么是101010101...要么是010101010,因此我们可以对结果分类讨论。直接模拟算出两种情况最少需要操作多少次,再取min即可。需要注意的是,如果是奇数串,那么结果只有一种,数量多的一定要放两侧。code:#include<bits/stdc++.h>#includ
  • 2024-07-02C++定义函数指针,回调C#
    C++定义函数指针。typedefint(__stdcall*delegate_func)(inta,intb);暴露接口:int__stdcallCPPcallCSharp(delegate_funcfunc);方法实现:int__stdcallCPPcallCSharp(delegate_funcfunc){returnfunc(1,2);}头文件calculator.h#ifndefLIB_CALCULATOR_H#defin
  • 2024-07-02C# 数据实体类生成工具 FreeSql.Generator
    安装和使用方法:传送门(大佬的学习笔记)dotnettoolinstall-gFreeSql.Generator.bat文件:__重新生成.batFreeSql.Generator-Razor"__razor.cshtml.txt"-NameOptions1,0,0,1-NameSpaceMyProject-DB"SqlServer,DataSource=192.168.1.1,1433;InitialCatalog=erp;UserID
  • 2024-07-02ASP.NET Core如何使用HttpClient调用WebService
    原文链接:https://www.yisu.com/jc/691937.html我们使用VS创建一个ASP.NETCoreWebAPI项目,由于是使用HttpClient,首先在ConfigureServices方法中进行注入。public void ConfigureServices(IServiceCollection services){    // 注入HttpClient    services.AddHt
  • 2024-07-01explain解析
    1.idselect的查询顺序,如果ID相同则按从上到下。2.selecttype区分查询是简单还是复杂查询1)simple:简单音询。查询不包含子音询和unionexplainselect*fromfilmwhereid=2:2)primary:复杂查询中最外层的select3)subquery:包含在select中的子查询(不在from子句中
  • 2024-07-01C#通过HttpWebRequest上传文件(自测通过)
    C#通过HttpWebRequest进行文件上传,自己亲测没问题,如果需要请自取usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Net;usingSystem.Reflection;usingSystem.Text;namespaceConsoleApp1{internalclassProgram
  • 2024-07-01339 Refresh Tokens 01(生成RefreshToken)
    步骤1、appsettings.json"Jwt":{"Issuer":"http://localhost:7221","Audience":"http://localhost:4200","EXPIRATION_MINUTES":1,"Key":"thisissecretkeyforjwtthisisse
  • 2024-07-01Unity 导航路线生成,小地图同步映射, 经过以后地图与小地图删除点位(点击小地图控制导航以及点击场景导航都会有路径点和路径点图标)
    效果:(如下图所示)操作方法:搭建小地图UI截取图片创建地面挂载如下代码:usingSystem.Collections.Generic;usingUnityEngine;usingUnityEngine.UI;[RequireComponent(typeof(MeshFilter),typeof(MeshCollider),typeof(MeshRenderer))]publicclassMap:Mo
  • 2024-07-01C#中is,as,using关键字的使用详情
    C#中is,as,using关键字的使用在C#中is,as,using关键字具有其特点及使用场景,其中is关键字用于检查该对象是否与给定类型兼容,as关键字用于将对象转换为指定类型,using关键字除了用于引入命名空间之外,还具有回收对象资源,如文件资源、网络资源和数据库资源等。一、is的使用:介绍:is