- 博客(31)
- 收藏
- 关注
翻译 ASP.NET Boilerplate abp应用层使用DTO上传文件
public interface IFileAppService:IApplicationService { Task UploadAsync(FileUploadInput input); //Task UploadAsync(FileUploadInput input,IFormFile file); Task<PagedResultDto<FileOutput>> GetListAsync(FilePagedInput..
2021-05-28 13:36:06
452
翻译 javascript 字节单位转换
//字节转换function byteConvert(bytes) { if (isNaN(bytes)) { return ''; } let symbols = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; let exp = Math.floor(Math.log(bytes)/Math.log(2)); if (exp < 1) { exp = 0; } let i = Ma.
2021-01-12 15:33:34
561
1
原创 javascript 字符串转换成纯数字格式
var txt="你好啊!abcd123456" var intcodestr=intcode.encode(txt); console.log(intcodestr); 输出:053076050103053097087057053090087075055055121066089087074106090068069121077122081049078103061061 va...
2020-04-09 17:00:23
262
翻译 asp 判断字符串是否在数组中
function inArray(str,arr) inArray=false if not isnull(arr) and isarray(arr) then for ii=0 to ubound(arr) if ucase(trim(arr(ii)))=ucase(trim(str)) then inAr...
2020-04-08 15:48:42
1261
转载 asp base64 解码
Function Base64Decode(ByVal base64String) 'rfc1521 '1999 Antonin Foller, Motobit Software, http://Motobit.cz Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ...
2020-04-07 15:03:50
657
翻译 JavaScript 日期格式化
//将日期转化为指定格式的字符串var DateFormat = function (date, formatStr) { var o = { "M+": date.getMonth() + 1, //月份 "d+": date.getDate(), //日 "h+": date.getHours(), //小时 "m+"...
2020-01-10 10:06:25
128
翻译 CSS实现底部固定位置
<style>html,body { margin:0; padding:0; height:100%;}#container { min-height:100%; position:relative;}#header { background:#ff0; padding:10px;}#body { padding:10...
2019-09-28 17:04:41
11935
原创 asp.net webapi HttpRequestMessage 获取get和post所有参数
/// <summary>/// 获取Http请求Get和Post所有参数/// </summary>/// <param name="request">HttpRequestMessage实例</param>/// <returns>Get和Post参数键值对集合</returns>public static c...
2019-08-23 17:09:06
9995
原创 NPOI R1C1引用样式转A1引用样式
using NPOI;using NPOI.SS.UserModel;using NPOI.HSSF.UserModel;using NPOI.SS.Util;using System.Text.RegularExpressions;/// <summary>/// R1C1样式转A1样式/// </summary>/// <param name=...
2019-05-24 16:15:49
879
原创 ASP VBScript 获取数组长度
由于需要在vb程序中获取数组的实际长度,在网上和w3c查了下都找不到获取数组长度的合适方法。所以自己就写了一个获取数组实际的长度的方法。实现原理很简单。就是循环判断数组的值,如果数组该项的值不为空"",那么长度就增加1。function ArrayLength(arry) dim len len=0 for each val in arry if val<>"" th...
2019-04-22 17:08:58
1048
原创 ASP VBScript 实现string.format 字符串格式化
'字符串格式化Format'str 被格式化的字符串'strArry 占位符数组,数组索引必须与占位符数字一致function FormatString(str,strArry) dim tempStr,index tempStr=str index=0 for each val in strArry dim placeholder placeholder="{"+Cstr...
2019-04-10 16:16:24
1600
原创 C# 调用BouncyCastle将RSA密钥与pem格式进行互转
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Security.Cryptography;using System.IO;using Org.BouncyCastle.Crypto...
2018-12-20 17:37:14
4400
原创 c# 生成指定长度的随机字符串(字母与数字)
/// <summary>/// 生成随机字符串/// </summary>public class RandomChars{ /// <summary> /// 字符类型 /// </summary> private enum CharType { /// <summary&g...
2018-12-11 14:35:30
6882
1
原创 highlight.js扩展代码行号
从GitHub下载highlightjs的源代码,下载地址:https://github.com/highlightjs/highlight.js在文件highlight.js中进行源代码的修改:(function(factory) { //highlightjs源代码 return hljs;});/** * 加入源代码行号 */(function(windo...
2018-11-27 12:26:31
2935
1
翻译 javascript 实现string.format 字符串格式化
String.prototype.format =function () { var args = arguments; return this.replace(/\{(\d+)\}/g, function(m, i){ return args[i]; }); };使用"abc{0}def{1}g".format ("1","2")输出...
2018-11-27 10:47:59
4710
原创 sql table数据转json数据
create proc [dbo].[TableToJson]@tableName varchar(30) --表名,临时表需要 # 开头/* 需要转换的列名,支持三种方式: * 1. ='', 转换所有字段; * 2. ='colName1,colName2,colName3,...', 转换输入的字段; * 3. ='<>,colName1,colName2,co...
2018-11-21 13:51:03
5741
翻译 sql 分割字符串
create function dbo.fn_split( @in_source nvarchar(4000), -- 被分割字符串 @in_delimiter nvarchar(10) -- 分割符)returns @temp table(seq int identity, value nvarchar(100))as begin declare @i int, @len i...
2018-11-21 11:52:46
488
原创 C# HttpWebRequest post 请求传参数
Dictionary<string, string> parameters = new Dictionary<string, string>(); //参数列表parameters.Add("paraName", "paraValue");string url = "";HttpWebRequest request = null;HttpWebRespon...
2018-11-16 15:53:34
14323
1
翻译 jquery dialog 使用URL加载窗体
<div id="dialogfrm" style="display:none"> <iframe id ="frame" style="border: 0px;" src="url" width='100%' height='100%'></iframe></div>$(&qu
2018-10-25 09:44:53
4367
原创 NPOI填充整列样式
定义填充整列样式函数 /// <summary>/// 填充列样式/// </summary>/// <param name="ws">ISheet实例</param>/// <param name="col">列索引</param>/// <param name=&quo
2018-10-16 15:39:04
2022
原创 NPOI 获取指定范围的单元格
//返回指定范围单元格public ICellRange<ICell> GetCellRange(ISheet ws, CellRangeAddress range){ int firstRow = range.FirstRow; int firstColumn = range.FirstColumn; int lastRow = range.LastR...
2018-10-16 14:59:55
7618
1
转载 Jquery validate验证表单时多个name相同的元素只验证第一个的问题
修复jquery.validate插件中name属性相同(如name=’a[]‘)时验证的bug使用jquery.validate插件http://jqueryvalidation.org/,当节点的name相同时候,脚本特意忽略剩余节点,导致所有相关节点的errMsg都显示在第一个相关节点上。这个bug在动态生成表单时候影响比较大。通过查询资料,找到一个解决方案:http://sta...
2018-10-12 17:52:14
732
转载 ASP中文URL解码URLDecode函数实现
大家都知道,在asp中,我们一般都通过 Server.UrlEncode 进行url的编码,这样使得一些特殊的字符能够通过链接正常访问,但当我们把这个编码后的url字符存入数据库后,有些时候需要程序读取这个url进行处理时,就需要对其进行url解码,在php中这些功能很完善,但asp中,我们是找不到Server.UrlDecode函数的,鉴于这个问题,我们就要自己写一个解码函数了,以下是一段支持中...
2018-09-18 14:04:17
5114
原创 NPOI填充整行样式
IRow r;ICellStyle cellStyle;gen_excel_cmd_fillWholeRowStyle(r,cellStyle)//填充整行样式public void gen_excel_cmd_fillWholeRowStyle(IRow r, ICellStyle cellStyle) { List<ICell> clist = r.Cells...
2018-08-28 17:23:40
3549
翻译 asp.net mvc 从客户端()中检测到有潜在危险的 Request.Form 值解决方法
在Web.config文件中添加<system.web><httpRuntime requestValidationMode="2.0"/></system.web>在MVC的Action添加如下两个特性[HttpPost][ValidateInput(false)]public string test(){}...
2018-08-25 22:59:08
903
原创 使用Vue框架Select元素在ie11加载页面时显示异常
<div id="app"> <select id="sl" v-model="selected"> <option disabled value="">请选择</option> <option value="1">A&l
2018-08-03 09:17:45
1616
转载 C#查看代码运行时间
//引用命名空间using System.Diagnostics;Stopwatch swatch = new Stopwatch(); //创建Stopwatch 实例swatch.Start(); //开始计时code.... //需要计时的代码swatch.Stop(); //结束计时string time=swatch.Elapsed...
2018-07-19 11:36:46
2268
原创 asp 生成guid
dim objTypeLib set objTypeLib = CreateObject("Scriptlet.TypeLib")'获取guid值guid = cstr(mid(objTypeLib.Guid, 2 ,len(objTypeLib.Guid)-4))
2018-07-17 14:45:23
937
原创 SqlServer获取日期天数
select day(dateadd(day,-1,convert(char(07),dateadd(month,1,@date),120)+'-01'))
2018-07-14 13:06:38
5562
原创 javascript接收asp.net mvc传递的json数据乱码
@{//后端传递的json数据string str = Model.jsonStr;}<script>var jsonstr=@str //接收失败,"转换被成&quot解决方法:1.var jsonstr=@Html.Raw(Json.Encode(str))2.var str= "@str";var reg = new RegExp("&quot;", "g"); ...
2018-07-14 12:51:55
766
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人