摘要: using System;using System.Collections;using System.Collections.Specialized;using System.Data;using System.Data.SqlClient;using System.Configuration;us 阅读全文
posted @ 2018-07-09 14:22 jeffrey77 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 理论上如果是单机部署,不用做任何配置工作 直接 SFID.NewID() 就可以使用。 如果分布式的话 .Net Framework项目在Application_Start中,.Net Core项目在Configure中添加 SFID.WorkerID = 1L; 就可以 1L换成你的不同机器代号就 阅读全文
posted @ 2017-12-15 17:18 jeffrey77 阅读(128) 评论(0) 推荐(0) 编辑
摘要: //利用时间和Guid作为种子产生随机数 private string GenerateUniqueID() { System.Text.StringBuilder sb = new System.Text.StringBuilder(); string str1 = DateTime.Now.ToString("yyyyMMddHHmmss"); Rando... 阅读全文
posted @ 2017-01-11 17:16 jeffrey77 阅读(247) 评论(0) 推荐(0) 编辑
摘要: JavaScript采用正则表达式实现startWith、endWith效果函数String.prototype.startWith=function(str){ var reg=new RegExp("^"+str); return reg.test(this);}String.prototype... 阅读全文
posted @ 2014-08-18 14:20 jeffrey77 阅读(5845) 评论(0) 推荐(0) 编辑
摘要: var h = document.getElementById('content').offsetHeight; //得到textarea的高度CKEDITOR.replace('content', {height:'100%'});//设置height:100%没用CKEDITOR.on('instanceReady', function (e) {var td = document.getElementById('cke_contents_' + e.editor.name), tbody = td.paren 阅读全文
posted @ 2014-03-04 09:36 jeffrey77 阅读(1040) 评论(0) 推荐(0) 编辑
摘要: 可视区域宽:document.documentElement.clientWidth (width + padding)可视区域高:document.documentElement.clientHeight (height + padding)可视区域宽:document.body.offsetWidth(包括边线的宽: width + padding + border)可视区域高:document.body.offsetHeight(包括边线的高:height + padding + border)内容高:document.body.scrollHeight文档高:document.body 阅读全文
posted @ 2013-12-15 20:28 jeffrey77 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 混乱的URI编码 JavaScript中编码有三种方法:escape、encodeURI、encodeURIComponent C#中编码主要方法:HttpUtility.UrlEncode、Server.UrlEncode、Uri.EscapeUriString、Uri.EscapeDataString JavaScript中的还好,只提供了三个,C#中主要用的就有这么多,还没有列出其他编码(HTML),一多就弄不明白,弄不明白就心生恐惧,心生恐惧就变得苦逼,本文就向大家详细解释在JavaScript及C#中如何对URI进行编码的方法(注:本文不涉及到其他编码)。escape:不推荐使... 阅读全文
posted @ 2013-11-27 21:14 jeffrey77 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 把平时网站上常用的一些实用功能代码片段通通收集起来,方面网友们学习使用,利用好的话可以加快网友们的开发速度,提高工作效率。目录如下:1、原生JavaScript实现字符串长度截取2、原生JavaScript获取域名主机3、原生JavaScript清除空格4、原生JavaScript替换全部5、原生JavaScript转义html标签6、原生JavaScript还原html标签7、原生JavaScript时间日期格式转换8、原生JavaScript判断是否为数字类型9、原生JavaScript设置cookie值10、原生JavaScript获取cookie值11、原生JavaScript加入收藏 阅读全文
posted @ 2013-09-11 14:15 jeffrey77 阅读(437) 评论(0) 推荐(0) 编辑
摘要: js原生态写法function getUrlParam(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r!=null) return unescape(r[2]); return null;}更全面的js写法:// 获取地址栏的参数数组function getUrlParams(){ var search = window.location.s 阅读全文
posted @ 2013-09-11 11:30 jeffrey77 阅读(353) 评论(0) 推荐(0) 编辑
摘要: Windows 平台换行符是 "\r\n"Unix/Linux 平台换行符是 "\n"从数据库中读取出来后,换行符不知为啥变成 "\n"c#:为保持平台的通用性,最好用 Environment.NewLine 阅读全文
posted @ 2013-08-08 10:49 jeffrey77 阅读(151) 评论(0) 推荐(0) 编辑