ASP.NET MVC学习-第一部分(引用自微软官方网站)
使用 ASP.NET MVC 创建一个任务列表应用程序本教程旨在让您了解构建 ASP.NET MVC 应用程序的过程。在本教程中,我将从头到尾构建整个 ASP.NET MVC 应用程序。我将介绍如何构建简单的任务列表应用程序。如果使用过 Active Server Pages 或 ASP.NET,则会发现 ASP.NET MVC 与其非常类似。ASP.NET MVC 视图非常类似于 Active Server Pages 应用程序中的页面。并且,与传统的 ASP.NET Web Forms 应用程序相同,ASP.NET MVC 可以完全访问 .NET Framework 提供的丰富的语言和类。希望您能够通过本教程了解构建 ASP.NET MVC 应用程序的过程与构建
自己实现AOP的权限管理的代码
using System;using System.Collections.Generic;using System.Reflection;using System.Linq;using System.Text;using System.Runtime.Remoting.Contexts;using System.Runtime.Remoting.Activation;using System.Runtime.Remoting.Messaging;namespace LiangQ.Authentification{ #region 自定义Aspect,实际意义就是一个消息接收器,加入到消息处理管道中 internal class AuthAspect:IMessageSink { private IMessageSink m_next; internal AuthAspect(IMessageSink next) { m_next = next;
抄来的AOP的程序,C#实现的
namespace LiangQ.UserAttribute{ [System.AttributeUsage(AttributeTargets.All)] public class AuthAttribute : ContextAttribute//contextattribute是所有上下文属性的根。 { public string ObjectName; //public AuthAttribute() : base("Auth") { } public AuthAttribute(string profile) : base ("Auth") { this.ObjectName = profile; } public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg) {
new与override在类派生时的作用
展示一段代码及结果,如果大家有深入的讲解,可以留下学习。 public class Number { public static int i = 123; public virtual void showInfo() { Console.WriteLine("base class --"); } public virtual void showNumber() { Console.WriteLine(i.ToString()); } } public class IntNumber:Number { new public static int i = 456; public new virtual void showInfo() { Console.WriteLine("
自定义属性
突发奇想在.NET上做一个权限控制的东西,想仿SAP权限管理的思想去实现。第一个要实现的东西在ABAP代码中经常见到的一个。[authentification (权限对象)]business logic code为了实现[authentification ()]就意味着我必须实现一个自定义属性,于是从MSDN上看了几篇文章,嘿嘿。写了下面的一些代码,不做过多解释,只是把代码贴出来。[System.AttributeUsage(AttributeTargets.All)]public class AuthAttribute : System.Attribute{public string ObjectName;public AuthAttribute (string name){this.ObjectName = name;}public void Print
博客开业的心情
终于可以有一个自己的博客了,希望自己每天的成长都在这里记录,也欢迎大家的光临。O(∩_∩)O~希望做一个不断学习的自由人。[@more@]