- 博客(30)
- 收藏
- 关注
转载 c# 红包二倍均值算法
public static List<double>RedPacketDoubleMethod(double total,int count,double min=0.01) { List<double> list = new List<double>(); if (total ...
2019-09-30 11:24:00
201
转载 c# 暴力破解中文编码方式
从api获取到一段文字,又不知道是啥编码,换了好多种方式都不行,直接暴力破解,看看哪个能出来正确中文,就用哪个public static void DecodeStr(string str) { foreach (var m in Encoding.GetEncodings()) { ...
2019-09-30 10:18:00
243
转载 vs调试 不能进入断点
vs断点显示黄白色,不是正常红色,不能进入断点,右键项目-属性-生成-优化代码,去掉勾选!转载于:https://www.cnblogs.com/huanyun/p/11608091.html
2019-09-29 15:23:00
1518
转载 c# http请求封装
public class NewHttpClient2 { public enum BodyFormat { Formed, Json } public BodyFormat BodyType; public string Method; p...
2019-09-23 14:49:00
964
转载 js 时区转换
function formatDate(strDate) { try{ var date = new Date(strDate); var timeoffset = (new Date().getTimezoneOffset()) * 60 * 1000; var len = date.g...
2019-09-19 14:05:00
182
转载 c# http请求接口
/// <summary> /// 不做catch处理,需要在外部做 /// </summary> /// <param name="url"></param> /// <param name="method">默认GET,空则补充为GET</pa...
2019-09-02 16:15:00
336
转载 netcore 中间件记录日志
public class Logger { private static ILog logger; static Logger() { if (logger == null) { var repository = LogManager.C...
2019-08-16 17:19:00
857
转载 netcore 调用log4net
public class Logger { private static ILog logger; static Logger() { if (logger == null) { var repository = LogManager.C...
2019-08-15 15:48:00
149
转载 netcore 从api下载文件并直接返回
[HttpGet] public IActionResult HttpReturnFile() { string url = "http://localhost:99/api/HttpFile/GetFile"; HttpWebRequest request = (HttpWebRequest)W...
2019-08-14 11:21:00
3039
转载 netcore 从api下载文件到本地
public IActionResult HttpDownFile() { string url = "http://localhost:99/api/HttpFile/GetFile"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url)...
2019-08-14 11:20:00
1621
转载 c# 取出字符串之间的字符串
public static string Midstr(string sourse, string s, string e) { Regex rg = new Regex("(?<=(" + s + "))[.\\s\\S]*?(?=(" + e + "))", RegexOptions.Multiline | RegexOption...
2019-08-14 10:52:00
262
转载 NetCore API 返回文件流
[HttpGet] public IActionResult GetFile(string filepath) { if (string.IsNullOrEmpty(filepath)) filepath = "D:\\ABC.log"; var provider = new FileEx...
2019-08-06 17:47:00
6466
转载 netcore 获取验证码
public IActionResult CreateIntCode() { string code = new Random().Next(999999).ToString("000000"); using (Bitmap image = new Bitmap(76, 32)) { ...
2019-07-29 17:12:00
445
转载 c# 随机字符串
///<summary> ///生成随机字符串 ///</summary> ///<param name="length">目标字符串的长度</param> ///<param name="useNum">是否包含数字,1=包含,默认为包含</p...
2019-07-29 17:09:00
121
转载 NetCore MimeMapping获取MIME
public static class MimeMapping { private abstract class MimeMappingDictionaryBase { private readonly Dictionary<string, string> _mappings = new Dictio...
2019-07-19 14:48:00
966
转载 MD5
public static string MD5Encrypt(string text) { MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); byte[] b = Encoding.Default.GetBytes(text); ...
2019-07-19 14:45:00
82
转载 c# netcore 发送http请求并接收返回数据
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Security.Cryptography;using System.Text;using System.Threading.Tasks;...
2019-07-15 09:00:00
861
转载 CentOS7 nginx安装与卸载
https://www.cnblogs.com/huiyi0521/p/10253341.html转载于:https://www.cnblogs.com/huanyun/p/11069000.html
2019-06-22 15:24:00
298
转载 c# 取出特定标签的内容 去除html标签
Match match = Regex.Match(x, "(?<=(<p[.\\s\\S]*?>))[.\\s\\S]*?(?=(</p>))", RegexOptions.Multiline | RegexOptions.Singleline); MatchCollection m=Regex.Matches(x, "(?&...
2019-06-12 11:33:00
627
转载 dotnet运行项目
在项目中运行dotnet,只需打开命令窗口,进入对应项目,输入dotnet run即可,发布后,需要把相关资源文件都发布出来,比如view等,然后输入dotnet xxx.dll即可转载于:https://www.cnblogs.com/huanyun/p/10931233.html...
2019-05-27 16:04:00
1114
转载 hangfire自定义访问api接口
这里Cron按照最低分钟访问,不过测试时不怎么准,Url为自定义接口,比如每天凌晨需要接口触发任务,就填写进去,还是有一定用的,Hangfire与项目分离。部分代码如下。using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;usi...
2019-05-27 15:59:00
716
转载 10万个数中取最大的10个数
var s=[6,7,8,9,10,11,12,13,14,15,16,17,23,24,25,26,27,28,0,1,2,3,4,5,18,19,20,21,22,99,55,-4,33,95]; var m=[,,] window.onload=function(){ m[0]=s[0]; m[1]=s[1]; ...
2019-05-23 16:06:00
1082
转载 指定的服务已标记为删除
无意碰到这个问题,服务界面关掉,自然就解决了。转载于:https://www.cnblogs.com/huanyun/p/10906503.html
2019-05-22 16:05:00
318
转载 FizzBuzz面试问题
之前看到这个问题,写一个程序打印1到100这些数字。但是遇到数字为3的倍数的时候,打印“Fizz”替代数字,5的倍数用“Buzz”代替,既是3的倍数又是5的倍数打印“FizzBuzz”。for(i=0;++i<101;console.log(i%5?f||i:f+'Buzz'))f=i%3?'':'Fizz'这是别人的实现,一时还没看懂,后来就自己折腾,va...
2019-05-16 08:34:00
277
转载 nuget源
https://api.nuget.org/v3/index.json转载于:https://www.cnblogs.com/huanyun/p/10854734.html
2019-05-13 08:27:00
328
转载 python 计算找零钱
#coding=gbk#定义零钱种类moneycount=[100,50,20,10,5,1]def getMax(x): m=[] while True: for i in moneycount: if i<=x: x-=i m.ap...
2018-12-20 09:45:00
738
转载 nginx默认设置
upstream abc { server localhost:52816 weight=5 max_fails=2 fail_timeout=600s; server localhost:52817 weight=5 max_fails=2 fail_timeout=600s; } server {...
2018-08-08 16:25:00
109
转载 An assembly specified in the application dependencies manifest (api.sys.com.deps.json) was not found
.net core运行失败,后来在csproj中加入<PropertyGroup> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest></PropertyGroup>重新发布运行即可。转载于:htt...
2018-08-08 15:41:00
1360
转载 MySql交叉表
钉钉的考勤,需要做个交叉表显示考勤记录,可以看看;DELIMITER $$USE `iopoa`$$DROP PROCEDURE IF EXISTS `dingkqdaily_excel_sp`$$CREATE DEFINER=`shenqi`@`%` PROCEDURE `dingkqdaily_excel_sp`(IN date_p VARCHAR(1...
2018-08-07 16:21:00
141
转载 VS项目依赖项全部感叹号
折腾很久,后来干脆新建一个sln,重新加载,搞定,头发都要掉了好几根。。。。转载于:https://www.cnblogs.com/huanyun/p/9199542.html
2018-06-19 17:15:00
2024
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人