10 2016 档案
摘要:@using System.Web.Optimization @using MultiPageSimpleTask.Entitys.Dtos; @model IList @{ Layout = null; ProductDto productDto = ViewBag.SingleProduct as ProductDto; } Hello World @Sc...
阅读全文
摘要:using System; using System.Linq; using System.Web; using System.Web.Http; using System.Web.Security; namespace OtherApi.Auth { public class AuthFilterOutside : AuthorizeAttribute { /...
阅读全文
摘要:using System; using AutoMapper; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace ConsoleApplication1 { class Program { private const string ConnStr = "Data Source=192.168...
阅读全文
摘要:你是否曾经或正在为如何能够在最短的时间内完成对一个包含上千个页面的网站的修改而苦恼?那么可以看一下本文的介绍,或许能够对你有所帮助。 什么是SSI? SSI是英文Server Side Includes的缩写,翻译成中文就是服务器端包含的意思。从技术角度上说,SSI就是HTML文件中,可以通过注释行调用的命令或指针。SSI 具有强大的功能,只要使用一条简单的SSI 命令就可以实现整个网站的内容更新...
阅读全文
摘要:/* 以下围绕Person类实现,Person类只有Name和Age两个属性 一.List排序 1.1 List提供了很多排序方法,sort(),Orderby(),OrderByDescending(). */ lstPerson = lstPerson.OrderByDescending(x=>x.Name).ToList(); //降序 lstPerson = lstPerson.Orde...
阅读全文
摘要://"{0}-{1}-{2}".format("xx","yy","zz") //显示xx-yy-zz String.prototype.format = function() { var result=this; if (arguments.length == 0) return null; for ( var i = 0; i < arguments.l...
阅读全文
摘要:/// /// Winform程序退出删除运行目录 FormClosed调用 /// private void DeletExeFile() { string fileName = @"C:\remove.bat"; StreamWriter bat = new St...
阅读全文
摘要:现在ajax应用已经相当广泛了,有很多不错的ajax框架可供使用。ajax是一个异步请求,也主要是一种客户端的脚本行为。那么,如何在请求之前为请求添加特殊的一些头部信息呢? 下面是一个简单的例子,我用jquery编写,它的ajax函数中,有一个beforeSend方法,这个方法接受一个参数,就代表了发起异步请求的XMLHttpRequest对象,我们可以用该对象的setRequestHeader...
阅读全文
摘要:问题 在某域名下使用Ajax向另一个域名下的页面请求数据,会遇到跨域问题。另一个域名必须在response中添加 Access-Control-Allow-Origin 的header,才能让前者成功拿到数据。 这句话对吗?如果对,那么流程是什么样的? 跨域 怎样才能算跨域?协议,域名,端口都必须相
阅读全文
摘要:[HttpPost] public HttpResponseMessage Upload() { string json = "{\"result\":\"true\"}"; return new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/jso...
阅读全文