代码改变世界

参数按照ASCII码从小到大排序

2019-04-04 16:36 by 熠旸, 5239 阅读, 0 推荐, 收藏, 编辑
摘要:public static void requestPay() { Dictionary<string, string> dics = new Dictionary<string, string>(); dics.Add("amount", amount); dics.Add("callback_u 阅读全文

C# 常量,变量,字段,属性,方法

2017-03-09 15:12 by 熠旸, 2030 阅读, 1 推荐, 收藏, 编辑
摘要:常量:指在程序编译时已经存在且在程序生命周期内不会发生改变的值,用const定义一个常量。 private class TestA --定义一个类时后边不加() { private const double Pi=3.14; private double GetPi() --输出pi值得方法,后边带 阅读全文

C# 反射学习

2017-03-09 14:09 by 熠旸, 359 阅读, 0 推荐, 收藏, 编辑
摘要:1.什么是反射(Reflection) 反射对于个人理解就是动态获取程序集的信息的方式。编译出来的.dll、.exe都是程序集。而程序集又包括:模块,而模块包含类型,类型又包含成员。而反射提供了一种方式,可以让程序在运行期间获取这些类型的信息。 Assembly类可以获得正在运行的装配件信息,也可以 阅读全文

Js常用方法总结

2016-08-11 11:01 by 熠旸, 204 阅读, 0 推荐, 收藏, 编辑
摘要:/* 手机类型判断 */ <script> $(function(){ var BrowserInfo = { userAgent: navigator.userAgent.toLowerCase(), isAndroid: Boolean(navigator.userAgent.match(/an 阅读全文

Input file 调用相机

2016-03-30 16:15 by 熠旸, 2646 阅读, 0 推荐, 收藏, 编辑
摘要:使用input:file标签, 去调用系统默认相机,摄像,录音功能,其实是有个capture属性,直接说明需要调用什么功能 <input type="file" accept="image/*" capture="camera"> <input type="file" accept="video/* 阅读全文

C#读取txt文件

2016-03-01 17:50 by 熠旸, 593 阅读, 0 推荐, 收藏, 编辑
摘要:public List<string> ReadtxtInfo() { FileStream fs = new FileStream(System.Web.HttpContext.Current.Server.MapPath("/") + @"/AllowList.txt", FileMode.Op 阅读全文

高并发下获取随机字符串

2016-03-01 17:46 by 熠旸, 449 阅读, 0 推荐, 收藏, 编辑
摘要:#region 获取随机字符串 //digit 最终返回的字符串的长度 public static string BuildCode(int digit) { StringBuilder resultCode = new StringBuilder(); Random ran = new Rando 阅读全文

将Datatable转换为Json数据

2015-08-27 16:35 by 熠旸, 310 阅读, 0 推荐, 收藏, 编辑
摘要:Datatable dt=new Datatable();StringBuilder JsonString = new StringBuilder(); //Exception Handling if (dt != null && dt.Rows.... 阅读全文

System.IO.Path 获得文件的后缀名

2015-08-03 17:10 by 熠旸, 456 阅读, 0 推荐, 收藏, 编辑
摘要:今天看视频文件的上传的问题, string ext = System.IO.Path.GetExtension(file.FileName).ToLower(); 这是获得FileName 文件的后缀名,比如: .mp4 阅读全文

用Js写的贪吃蛇游戏

2015-07-22 12:00 by 熠旸, 895 阅读, 0 推荐, 收藏, 编辑
摘要:snakeSnake操作提示:按上下左右键操作,按P键暂停或继续 阅读全文