This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>快速从文档描述生成实体</title> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<script src="http://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> | |
</head> | |
<body style="padding-top: 10px;"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ImageHelper | |
{ | |
/// <summary> | |
/// | |
/// </summary> | |
/// <param name="jpeg_image_upload"></param> | |
/// <param name="target_height"></param> | |
/// <param name="fixedType"></param> | |
/// <param name="path"></param> | |
/// <returns>返回是否保存成功</returns> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebUploader.Uploader.prototype._originInit = WebUploader.Uploader.prototype._init; | |
$.extend(WebUploader.Uploader.prototype, { | |
_init: function () { | |
if (!!arguments) { | |
this._originInit(arguments[0]); | |
} else { | |
this._originInit(); | |
} | |
if (!!this._instanceInit) { | |
this._instanceInit(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 根据传入要更新的表达式获取更新的列名 | |
/// </summary> | |
/// <param name="funExpression"></param> | |
/// <returns></returns> | |
private IList<string> GetColumnNames(Expression<Func<TEntityType, object>> funExpression) | |
{ | |
if (funExpression.Body.NodeType != ExpressionType.New) | |
throw new ArgumentException("请传入正确表达式!", "funExpression"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 获得客户端IP | |
/// </summary> | |
/// <returns></returns> | |
private static string GetClientIp() | |
{ | |
string ipAddress = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; | |
if (!string.IsNullOrEmpty(ipAddress)) | |
return ipAddress; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HelpPageConfig 页中调用示例: | |
config.SetDocumentationProvider(new XmlDocumentationProvider("App_Data/1.XML;App_Data/2.XML;App_Data/3.XML")); | |
修改XmlDocumentationProvider 类中构造函数: | |
/// <summary> | |
/// Initializes a new instance of the <see cref="XmlDocumentationProvider"/> class. | |
/// </summary> | |
/// <param name="documentPath">The physical path to XML document.</param> | |
public XmlDocumentationProvider(string documentPath) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
ThreaStaticTest test = new ThreaStaticTest(); | |
ThreaStaticTest.Num = 8; | |
ThreaStaticTest.TreadStaticNum = 8; | |
test.DymNum = 8; | |
test.ConsoleNum(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//百度地图的坐标转换,由于百度地图在GCJ02协议的基础上又做了一次处理,变为 BD09协议的坐标,以下是坐标的转化方式,可以方便和其他平台转化 | |
jQuery.MapConvert = { | |
x_pi: 3.14159265358979324 * 3000.0 / 180.0, | |
/// <summary> | |
/// 中国正常坐标系GCJ02协议的坐标,转到 百度地图对应的 BD09 协议坐标 | |
/// point 为传入的对象,例如{lat:xxxxx,lng:xxxxx} | |
/// </summary> | |
Convert_GCJ02_To_BD09: function (point) { | |
var x = point.lng, y = point.lat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const double x_pi = 3.14159265358979324 * 3000.0 / 180.0; | |
/// <summary> | |
/// 中国正常坐标系GCJ02协议的坐标,转到 百度地图对应的 BD09 协议坐标 | |
/// </summary> | |
/// <param name="lat">维度</param> | |
/// <param name="lng">经度</param> | |
public static void Convert_GCJ02_To_BD09(ref double lat,ref double lng) | |
{ | |
double x = lng, y = lat; | |
double z =Math.Sqrt(x * x + y * y) + 0.00002 * Math.Sin(y * x_pi); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// 根据数字生成短码 | |
/// </summary> | |
/// <param name="num">需要加密的转换的长整形</param> | |
/// <returns></returns> | |
public static string GetShortCode(long num) | |
{ | |
// 排除 0 4 o v | |
char[] chars = new char[] |