摘要: [Authorize] public class HomeController : Controller { [AllowAnonymous] public ActionResult Login() { string... 阅读全文
posted @ 2015-07-07 21:27 nbu_djw 阅读(806) 评论(1) 推荐(0) 编辑
摘要: 在MVC中使用WebApi,初始化的时候App_Start文件夹中已经默认生成路由信息,不需要在RouteConfig中添加。public static class WebApiConfig { public static void Register(HttpConfigurat... 阅读全文
posted @ 2015-07-07 11:10 nbu_djw 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 学习链接 http://www.cnblogs.com/JustRun1983/p/3967757.html 第一部分: 直接表达式方法 invoke方法 使用自定义Middleware 第二部分: a:在所有程序前调用,直接使用startup。 b:在部分路径下调用,需要在appSetting里设 阅读全文
posted @ 2015-07-05 23:07 nbu_djw 阅读(844) 评论(0) 推荐(0) 编辑
摘要: routes.MapRoute( name: "blog", //包含参数的url url: "{year}-{month}-{day}", defaults: new... 阅读全文
posted @ 2015-07-02 22:21 nbu_djw 阅读(178) 评论(0) 推荐(0) 编辑
摘要: mvc可以直接配置路由,虽然aspx已经是过去式,但是学习一下也是有必要的。1、直接在global.ashax中Application_BeginRequest方法中讲url重写 protected void Application_BeginRequest(object sender, ... 阅读全文
posted @ 2015-07-02 14:35 nbu_djw 阅读(438) 评论(0) 推荐(0) 编辑
摘要: using Owin;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Microsoft.AspNet.Signa... 阅读全文
posted @ 2015-06-30 14:38 nbu_djw 阅读(380) 评论(0) 推荐(0) 编辑
摘要: [HubName("djwChat")] public class ChatHub:Hub { public void Send(string name) { //动态表达式 Clients.All.addMs... 阅读全文
posted @ 2015-06-29 22:46 nbu_djw 阅读(442) 评论(1) 推荐(0) 编辑
摘要: ajax网页聊天室,接收信息递归循环。 $(function () { $("#btn1").click(function () { $.post("MsgAJAX.ashx", { "action": "send", "msg": ... 阅读全文
posted @ 2015-06-29 10:12 nbu_djw 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 用ManulResetEvent实现生产者消费者,声明了两个ManulResetEvent类型变量,其实用一个也可以。现在用AutoResetEvent实现。Auto和Manual的区别是Auto只唤醒一个线程,Manual是唤醒所有。 public class AreTest ... 阅读全文
posted @ 2015-06-28 18:48 nbu_djw 阅读(178) 评论(0) 推荐(0) 编辑
摘要: public class MreTest1 { public static ManualResetEvent mre = new ManualResetEvent(false); public static void Add() ... 阅读全文
posted @ 2015-06-28 17:18 nbu_djw 阅读(163) 评论(0) 推荐(0) 编辑