随笔分类 -  C#.Net & MVC

摘要:using System; using System.Web; using System.Collections; namespace MSCL { /// /// Cache辅助类 /// public class CacheHelper { /// /// 获取数据缓存 /// /... 阅读全文
posted @ 2016-12-17 16:22 深南大道 阅读(182) 评论(0) 推荐(0) 编辑
摘要:/* Sqlserver数据库开始相关服务 以下示例显示了如何查看 OLE Automation Procedures 的当前设置。0未启用 */ EXEC sp_configure 'show advanced option', '1' --只有这个高级选项被打开的时候,才有权限修改其他配置。 go RECONFIGURE --运行RECONFIGURE语句进行安装,也就是说,使以上语... 阅读全文
posted @ 2016-12-17 10:04 深南大道 阅读(1448) 评论(0) 推荐(1) 编辑
摘要:using System; using System.IO; using System.Runtime.CompilerServices; using System.Text; namespace SystemTask { public class CensusdemoTask { System.Threading.Timer timer; pri... 阅读全文
posted @ 2016-12-16 20:04 深南大道 阅读(397) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.Common; using System.Threading.Tasks; using JianKu.Dal; using JianKu.Model; u... 阅读全文
posted @ 2016-12-08 19:02 深南大道 阅读(172) 评论(0) 推荐(0) 编辑
摘要:缓存是用来提高应用性能,降低服务器压力。适用于数据不易变,数据易通用的情景, 对于动态查询数据,例如数据分析,最好放弃使用缓存。使用缓存最麻烦的就是保持源数据和缓存的中的数据一致。 缓存(Cache)依赖,就是缓存是否更新依赖于其它Object。.net的缓存依赖主要用到的类就是CacheDepen 阅读全文
posted @ 2016-12-01 13:51 深南大道 阅读(254) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sample2 { class Program { static void Main(string[] args)... 阅读全文
posted @ 2016-11-28 20:19 深南大道 阅读(590) 评论(0) 推荐(1) 编辑
摘要:EasyUI ComboTree示例 using System; using System.Web; using System.Collections.Generic; using Newtonsoft.Js... 阅读全文
posted @ 2016-11-19 16:54 深南大道 阅读(270) 评论(0) 推荐(0) 编辑
摘要:/// /// 反射得到实体类的字段名称和值 /// var dict = GetProperties(model); /// /// 实体类 /// 实例化 /// public static Dictionary GetProperties(T t) { var ret = new Dictionary(); if (t == null) { return null; } Prop... 阅读全文
posted @ 2016-11-18 15:54 深南大道 阅读(414) 评论(0) 推荐(0) 编辑
摘要:@using System.Web.Optimization @using MultiPageSimpleTask.Entitys.Dtos; @model IList @{ Layout = null; ProductDto productDto = ViewBag.SingleProduct as ProductDto; } Hello World @Sc... 阅读全文
posted @ 2016-10-27 11:57 深南大道 阅读(249) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Security; namespace OtherApi.Auth { public class AuthFilterOutside : AuthorizeAttribute { /... 阅读全文
posted @ 2016-10-26 17:00 深南大道 阅读(301) 评论(0) 推荐(0) 编辑
摘要:using System; using AutoMapper; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace ConsoleApplication1 { class Program { private const string ConnStr = "Data Source=192.168... 阅读全文
posted @ 2016-10-25 18:12 深南大道 阅读(223) 评论(0) 推荐(0) 编辑
摘要:/* 以下围绕Person类实现,Person类只有Name和Age两个属性 一.List排序 1.1 List提供了很多排序方法,sort(),Orderby(),OrderByDescending(). */ lstPerson = lstPerson.OrderByDescending(x=>x.Name).ToList(); //降序 lstPerson = lstPerson.Orde... 阅读全文
posted @ 2016-10-21 14:58 深南大道 阅读(350) 评论(0) 推荐(0) 编辑
摘要:问题 在某域名下使用Ajax向另一个域名下的页面请求数据,会遇到跨域问题。另一个域名必须在response中添加 Access-Control-Allow-Origin 的header,才能让前者成功拿到数据。 这句话对吗?如果对,那么流程是什么样的? 跨域 怎样才能算跨域?协议,域名,端口都必须相 阅读全文
posted @ 2016-10-11 13:09 深南大道 阅读(228) 评论(0) 推荐(0) 编辑
摘要:[HttpPost] public HttpResponseMessage Upload() { string json = "{\"result\":\"true\"}"; return new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/jso... 阅读全文
posted @ 2016-10-10 17:48 深南大道 阅读(382) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Linq; using System.Reflection; using System.Text; using System.Threading... 阅读全文
posted @ 2016-09-29 10:24 深南大道 阅读(711) 评论(0) 推荐(0) 编辑
摘要://MVC HTML辅助类常用方法记录 (1)@Html.DisplayNameFor(model => model.Title)是显示列名, (2)@Html.DisplayFor(modelItem => item.Title)是显示列的内容 (3)@Html.ActionLink("Create New", "Create")是超链接,跳转到model中的create页面,引用的是co... 阅读全文
posted @ 2016-08-27 22:32 深南大道 阅读(216) 评论(0) 推荐(0) 编辑
摘要:%n异常时间:%d [%t] %n异常级别:%-5p %n异 常 类:%c ... 阅读全文
posted @ 2016-07-22 22:25 深南大道 阅读(167) 评论(0) 推荐(0) 编辑
摘要:已安装软件:VS2015 Mysql服务器 使用时: 使用EF设计器 此时此刻,发现二逼了,咋没有mysql????(好吧,上图是用的别人的,本机已经木有这个没有mysql的界面了) 好吧,下面重点: 需要下载安装: 1:mysql-for-visualstudio-1.2.6.msi http:/ 阅读全文
posted @ 2016-07-08 21:49 深南大道 阅读(218) 评论(0) 推荐(0) 编辑
摘要:uploadify3.2上传文件 using System; using System.Collections.Generic; using Sys... 阅读全文
posted @ 2016-07-08 17:27 深南大道 阅读(166) 评论(0) 推荐(0) 编辑
摘要:@{ ViewBag.Title = "json示例项目"; } @Scripts.Render("~/bundles/jquery") json示例项目View GetJsonData1 GetJsonData2 暂无数据 using System; using System.Collections.Generic; using System.Glo... 阅读全文
posted @ 2016-06-29 17:11 深南大道 阅读(734) 评论(0) 推荐(0) 编辑