lASP.NET MVC系列文章

【01】浅谈Google Chrome浏览器(理论篇)

【02】浅谈Google Chrome浏览器(操作篇)(上)

【03】浅谈Google Chrome浏览器(操作篇)(下)

【04】浅谈ASP.NET框架

【05】浅谈ASP.NET MVC运行过程

【06】浅谈ASP.NET MVC 控制器

【07】浅谈ASP.NET MVC 路由

【08】浅谈ASP.NET MVC 视图

【09】浅谈ASP.NET MVC 视图与控制器传递数据

【10】浅谈jqGrid 在ASP.NET MVC中增删改查

【11】浅谈ASP.NET 页面之间传值的几种方式

【12】浅谈缓存技术在ASP.NET中的运用

【13】浅谈NuGet在VS中的运用

【14】浅谈ASP.NET 程序发布过程

【15】浅谈数据注解和验证

【16】浅谈依赖注入

【17】浅谈表单和HTML辅助方法

【18】浅谈基于APS.NET身份验证

【19】浅谈ASP.NET MVC 模型

【20】浅谈ASP.NET MVC 单元测试

【21】浅谈ASP.NET MVC网络安全;

【22】浅谈ASP.NET MVC八大类扩展

【23】再谈ASP.NET MVC Routing

【24】浅谈ASP.NET 高级话题

【25】浅谈大型ASP.NET MVC项目(含DEMO)

【26】下一系列:ASP.NET WebAPI


一    引入背景

我们知道,MVC基架为我们提供了很多基础类,当需要使用时,只需调用即可,以ActionResult为例,其有很多子类,如ContentResult,EmptyResult,FileResult,HttpStatusCodeResult,JavaScriptResult,JsonResult,RedirectResult,RedirectToRouteResult,ViewResultBase,FileContentResult,FilePathResult,FileStreamResult,ViewResult,PartialResult,

然而,尽管MVC基架提供了众多类供我们调用,但却并不是包括所有功能的类,比如,我需要返回XML格式的数据,或下载CSV格式的数据,此时,MVC基架就没提供相应的类。因此,MVC类的扩展就迫在眉睫了。

在本篇文章中,主要讲解MVC比较核心的八大扩展类,一共分为两篇,即浅谈ASP.NET MVC八大类扩展(上篇)和浅谈ASP.NET MVC八大类扩展(下篇)。

其中,本篇文章主要讲解MVC基架提供的ActionResult及其子孙类,自定义扩展XMLResult和CsvResult,下篇文章将讲解剩下的七大类自定义扩展:Filter扩展,RazorViewEngine扩展,HtmlHelper扩展,Validator扩展,ModelBinder扩展,ControllerFactory注入扩展,Lambda 树扩展。

二   ASP.NET MVC扩展概述

但凡涉及到架构,我们首先都会关心安全性,稳定性,可扩展性等特征,当然,ASO.NET MVC也不例外,MVC之所以比WebForm流行,不仅仅在于其实现前后端的松耦合,而且其也支持强大的自定义扩展,在本篇文章中,我们就是运用MVC支持自定义扩展这一特性来进行自定义扩展,从而实现个性化项目需求。

三    代码实例

(一) ActionResult扩展

1 AtionResult内置扩展

ASP.NET MVC提供了如下内置扩展类.

1.1  上图简要概述

(1)ActionResult类继承Object类;

(2)ContentResult,EmptyResult,FileResult,HttpStatusCodeResult,JavaScriptResult,JsonResult,ViewResultBase,RedirectToRouteResult,RedirectResult 九大类继承类ActionResult;

(3)FileContentResult,FilePathResult,FileStreamResult  三大类继承类FileResult;

(4)ViewResult,PartialViewResult两大类继承类ViewResultBase;

1.2 ActionResult讲解

功能:封装一个操作方法的结果并用于代表该操作方法执行框架级操作。

在Mvc中,我们对如下代码再熟悉不过了。

public ActionResult Index()
{
return View();
}

F12查看ActionResult定义

 namespace System.Web.Mvc
{
//
// 摘要:
// 表示操作方法的结果。
public abstract class ActionResult
{
//
// 摘要:
// 初始化 System.Web.Mvc.ActionResult 类的新实例。
protected ActionResult(); //
// 摘要:
// 通过从 System.Web.Mvc.ActionResult 类继承的自定义类型,启用对操作方法结果的处理。
//
// 参数:
// context:
// 用于执行结果的上下文。上下文信息包括控制器、HTTP 内容、请求上下文和路由数据。
public abstract void ExecuteResult(ControllerContext context);
}
}

不难看出,ActionResult具有如下特征:

(1)抽象类;

(2)一个只可继承的构造函数;

(3)一个未实现的抽象方法;

1.2.1  ContentResult讲解

功能:表示用户定义的内容类型,该类型是操作方法的结果。

定义:查看定义

不难看出,ContentResult具有如下特征:

(1)继承自类ActionResult

(2)包含一个构造方法,一个重写ActionResultl类的抽象方法ExecuteResult(ControllerContext context),和三个属性;

(3)完整定义

 public class ContentResult : ActionResult
{
// Methods
public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
HttpResponseBase response = context.HttpContext.Response;
if (!string.IsNullOrEmpty(this.ContentType))
{
response.ContentType = this.ContentType;
}
if (this.ContentEncoding != null)
{
response.ContentEncoding = this.ContentEncoding;
}
if (this.Content != null)
{
response.Write(this.Content);
}
} // Properties
public string Content { get; set; } public Encoding ContentEncoding { get; set; } public string ContentType { get; set; }
}

(4)我们来看看具体例子:

如我们向页面输出“Alan_beijing”,可采取如下两种方式。

方式一:

 public ContentResult ContextResultTest()
{
return Content("Alan_beijing");
}

测试结果

方式二

 public ContentResult ContextResultTest()
{
//string str = "<html>" + "<head></head>" + "<body>" + "Alan_beijing" + "</body>" + "</html>";
string str = "<html><head></head></body>Alan_beijing</body></html>";
return Content(str);
}

测试结果

总之,大家在使用时,可以把ContentResult当作Responce.Write()使用。

1.2.2  EmptyResult

功能:表示一个不执行任何操作的结果,如不返回任何内容的控制器操作方法。

(1)查看定义

(2)完整定义

 public class EmptyResult : ActionResult
{
// Fields
private static readonly EmptyResult _singleton = new EmptyResult(); // Methods
public override void ExecuteResult(ControllerContext context)
{
} // Properties
internal static EmptyResult Instance =>
_singleton;
}

(3)总结

EmptyResult不执行任何操作,相当于如下功能。

 public ContentResult ContextResultTest()
{
return Content("");
}

1.2.3  FileResult

功能:表示一个用于将二进制文件内容发送到响应的基类。

(1)查看定义

(2)完整定义

 public abstract class FileResult : ActionResult
{
// Fields
private string _fileDownloadName; // Methods
protected FileResult(string contentType)
{
if (string.IsNullOrEmpty(contentType))
{
throw new ArgumentException(MvcResources.Common_NullOrEmpty, "contentType");
}
this.ContentType = contentType;
} public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
HttpResponseBase response = context.HttpContext.Response;
response.ContentType = this.ContentType;
if (!string.IsNullOrEmpty(this.FileDownloadName))
{
string headerValue = ContentDispositionUtil.GetHeaderValue(this.FileDownloadName);
context.HttpContext.Response.AddHeader("Content-Disposition", headerValue);
}
this.WriteFile(response);
} protected abstract void WriteFile(HttpResponseBase response); // Properties
public string ContentType { get; private set; } public string FileDownloadName
{
get =>
(this._fileDownloadName ?? string.Empty);
set
{
this._fileDownloadName = value;
}
} // Nested Types
internal static class ContentDispositionUtil
{
// Fields
private const string HexDigits = "0123456789ABCDEF"; // Methods
private static void AddByteToStringBuilder(byte b, StringBuilder builder)
{
builder.Append('%');
int num = b;
AddHexDigitToStringBuilder(num >> , builder);
AddHexDigitToStringBuilder(num % 0x10, builder);
} private static void AddHexDigitToStringBuilder(int digit, StringBuilder builder)
{
builder.Append("0123456789ABCDEF"[digit]);
} private static string CreateRfc2231HeaderValue(string filename)
{
StringBuilder builder = new StringBuilder("attachment; filename*=UTF-8''");
foreach (byte num in Encoding.UTF8.GetBytes(filename))
{
if (IsByteValidHeaderValueCharacter(num))
{
builder.Append((char) num);
}
else
{
AddByteToStringBuilder(num, builder);
}
}
return builder.ToString();
} public static string GetHeaderValue(string fileName)
{
foreach (char ch in fileName)
{
if (ch > '\x007f')
{
return CreateRfc2231HeaderValue(fileName);
}
}
ContentDisposition disposition = new ContentDisposition {
FileName = fileName
};
return disposition.ToString();
} private static bool IsByteValidHeaderValueCharacter(byte b)
{
if ((0x30 <= b) && (b <= 0x39))
{
return true;
}
if ((0x61 <= b) && (b <= 0x7a))
{
return true;
}
if ((0x41 <= b) && (b <= ))
{
return true;
}
switch (b)
{
case 0x3a:
case 0x5f:
case 0x7e:
case 0x24:
case 0x26:
case 0x21:
case 0x2b:
case 0x2d:
case 0x2e:
return true;
}
return false;
}
}
}

1.2.4  HttpStatusCodeResult

功能:提供一种用于返回带特定 HTTP 响应状态代码和说明的操作结果的方法。

(1)定义

(2)完整定义

 public class HttpStatusCodeResult : ActionResult
{
// Methods
public HttpStatusCodeResult(int statusCode) : this(statusCode, null)
{
} public HttpStatusCodeResult(HttpStatusCode statusCode) : this(statusCode, null)
{
} public HttpStatusCodeResult(int statusCode, string statusDescription)
{
this.StatusCode = statusCode;
this.StatusDescription = statusDescription;
} public HttpStatusCodeResult(HttpStatusCode statusCode, string statusDescription) : this((int) statusCode, statusDescription)
{
} public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
context.HttpContext.Response.StatusCode = this.StatusCode;
if (this.StatusDescription != null)
{
context.HttpContext.Response.StatusDescription = this.StatusDescription;
}
} // Properties
public int StatusCode { get; private set; } public string StatusDescription { get; private set; }
}

1.2.5 JavaScriptResult

功能:将 JavaScript 内容发送到响应。

(1)定义

(2)完整定义

 public class JavaScriptResult : ActionResult
{
// Methods
public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
HttpResponseBase response = context.HttpContext.Response;
response.ContentType = "application/x-javascript";
if (this.Script != null)
{
response.Write(this.Script);
}
} // Properties
public string Script { get; set; }
}

1.2.6  JsonResult

功能:表示一个类,该类用于将 JSON 格式的内容发送到响应。

(1)定义

(2)完整定义

 public class JsonResult : ActionResult
{
// Methods
public JsonResult()
{
this.JsonRequestBehavior = JsonRequestBehavior.DenyGet;
} public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if ((this.JsonRequestBehavior == JsonRequestBehavior.DenyGet) && string.Equals(context.HttpContext.Request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException(MvcResources.JsonRequest_GetNotAllowed);
}
HttpResponseBase response = context.HttpContext.Response;
if (!string.IsNullOrEmpty(this.ContentType))
{
response.ContentType = this.ContentType;
}
else
{
response.ContentType = "application/json";
}
if (this.ContentEncoding != null)
{
response.ContentEncoding = this.ContentEncoding;
}
if (this.Data != null)
{
JavaScriptSerializer serializer = new JavaScriptSerializer();
if (this.MaxJsonLength.HasValue)
{
serializer.MaxJsonLength = this.MaxJsonLength.Value;
}
if (this.RecursionLimit.HasValue)
{
serializer.RecursionLimit = this.RecursionLimit.Value;
}
response.Write(serializer.Serialize(this.Data));
}
} // Properties
public Encoding ContentEncoding { get; set; } public string ContentType { get; set; } public object Data { get; set; } public JsonRequestBehavior JsonRequestBehavior { get; set; } public int? MaxJsonLength { get; set; } public int? RecursionLimit { get; set; }
}

(3)总结

JsonResult首先将指定的对象序列化为Json字符串,然后将字符串写入到HTTP输出流。

1.2.7 RedirectResult

功能:通过重定向到指定的 URI 来控制对应用程序操作的处理。

(1)定义

(2)完整定义

 public class RedirectResult : ActionResult
{
// Methods
public RedirectResult(string url) : this(url, false)
{
} public RedirectResult(string url, bool permanent)
{
if (string.IsNullOrEmpty(url))
{
throw new ArgumentException(MvcResources.Common_NullOrEmpty, "url");
}
this.Permanent = permanent;
this.Url = url;
} public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (context.IsChildAction)
{
throw new InvalidOperationException(MvcResources.RedirectAction_CannotRedirectInChildAction);
}
string url = UrlHelper.GenerateContentUrl(this.Url, context.HttpContext);
context.Controller.TempData.Keep();
if (this.Permanent)
{
context.HttpContext.Response.RedirectPermanent(url, false);
}
else
{
context.HttpContext.Response.Redirect(url, false);
}
} // Properties
public bool Permanent { get; private set; } public string Url { get; private set; }
}

1.2.8 RedirectToRouteResult

功能:表示使用指定的路由值字典来执行重定向的结果。

(1)定义

(2)完整定义

 public class RedirectToRouteResult : ActionResult
{
// Fields
private RouteCollection _routes; // Methods
public RedirectToRouteResult(RouteValueDictionary routeValues) : this(null, routeValues)
{
} public RedirectToRouteResult(string routeName, RouteValueDictionary routeValues) : this(routeName, routeValues, false)
{
} public RedirectToRouteResult(string routeName, RouteValueDictionary routeValues, bool permanent)
{
this.Permanent = permanent;
this.RouteName = routeName ?? string.Empty;
this.RouteValues = routeValues ?? new RouteValueDictionary();
} public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (context.IsChildAction)
{
throw new InvalidOperationException(MvcResources.RedirectAction_CannotRedirectInChildAction);
}
string str = UrlHelper.GenerateUrl(this.RouteName, null, null, this.RouteValues, this.Routes, context.RequestContext, false);
if (string.IsNullOrEmpty(str))
{
throw new InvalidOperationException(MvcResources.Common_NoRouteMatched);
}
context.Controller.TempData.Keep();
if (this.Permanent)
{
context.HttpContext.Response.RedirectPermanent(str, false);
}
else
{
context.HttpContext.Response.Redirect(str, false);
}
} // Properties
public bool Permanent { get; private set; } public string RouteName { get; private set; } internal RouteCollection Routes
{
get
{
if (this._routes == null)
{
this._routes = RouteTable.Routes;
}
return this._routes;
}
set
{
this._routes = value;
}
} public RouteValueDictionary RouteValues { get; private set; }
}

1.2.9  ViewResultBase

功能:表示一个用于为视图提供模型并向响应呈现视图的基类。

(1)定义

(2)完整定义

 public abstract class ViewResultBase : ActionResult
{
// Fields
private DynamicViewDataDictionary _dynamicViewData;
private TempDataDictionary _tempData;
private ViewDataDictionary _viewData;
private ViewEngineCollection _viewEngineCollection;
private string _viewName; // Methods
protected ViewResultBase()
{
} public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (string.IsNullOrEmpty(this.ViewName))
{
this.ViewName = context.RouteData.GetRequiredString("action");
}
ViewEngineResult result = null;
if (this.View == null)
{
result = this.FindView(context);
this.View = result.View;
}
TextWriter output = context.HttpContext.Response.Output;
ViewContext viewContext = new ViewContext(context, this.View, this.ViewData, this.TempData, output);
this.View.Render(viewContext, output);
if (result != null)
{
result.ViewEngine.ReleaseView(context, this.View);
}
} protected abstract ViewEngineResult FindView(ControllerContext context); // Properties
public object Model =>
this.ViewData.Model; public TempDataDictionary TempData
{
get
{
if (this._tempData == null)
{
this._tempData = new TempDataDictionary();
}
return this._tempData;
}
set
{
this._tempData = value;
}
} public IView View { get; set; } [Dynamic]
public object ViewBag
{
[return: Dynamic]
get
{
Func<ViewDataDictionary> viewDataThunk = null;
if (this._dynamicViewData == null)
{
if (viewDataThunk == null)
{
viewDataThunk = () => this.ViewData;
}
this._dynamicViewData = new DynamicViewDataDictionary(viewDataThunk);
}
return this._dynamicViewData;
}
} public ViewDataDictionary ViewData
{
get
{
if (this._viewData == null)
{
this._viewData = new ViewDataDictionary();
}
return this._viewData;
}
set
{
this._viewData = value;
}
} public ViewEngineCollection ViewEngineCollection
{
get =>
(this._viewEngineCollection ?? ViewEngines.Engines);
set
{
this._viewEngineCollection = value;
}
} public string ViewName
{
get =>
(this._viewName ?? string.Empty);
set
{
this._viewName = value;
}
}
}

1.2.10  FileContentResult

功能:将二进制文件的内容发送到响应

定义:

 public class FileContentResult : FileResult
{
// Methods
public FileContentResult(byte[] fileContents, string contentType) : base(contentType)
{
if (fileContents == null)
{
throw new ArgumentNullException("fileContents");
}
this.FileContents = fileContents;
} protected override void WriteFile(HttpResponseBase response)
{
response.OutputStream.Write(this.FileContents, , this.FileContents.Length);
} // Properties
public byte[] FileContents { get; private set; }
}

1.2.11  FilePathResult

功能:将文件的内容发送到响应。

定义:

 public class FilePathResult : FileResult
{
// Methods
public FilePathResult(string fileName, string contentType) : base(contentType)
{
if (string.IsNullOrEmpty(fileName))
{
throw new ArgumentException(MvcResources.Common_NullOrEmpty, "fileName");
}
this.FileName = fileName;
} protected override void WriteFile(HttpResponseBase response)
{
response.TransmitFile(this.FileName);
} // Properties
public string FileName { get; private set; }
}

1.2.12  FilestreamResult

功能:使用Stream实例将二进制内容发送到响应。

定义:

 public class FileStreamResult : FileResult
{
// Fields
private const int BufferSize = 0x1000; // Methods
public FileStreamResult(Stream fileStream, string contentType) : base(contentType)
{
if (fileStream == null)
{
throw new ArgumentNullException("fileStream");
}
this.FileStream = fileStream;
} protected override void WriteFile(HttpResponseBase response)
{
Stream outputStream = response.OutputStream;
using (this.FileStream)
{
byte[] buffer = new byte[0x1000];
while (true)
{
int count = this.FileStream.Read(buffer, , 0x1000);
if (count == )
{
return;
}
outputStream.Write(buffer, , count);
}
}
} // Properties
public Stream FileStream { get; private set; }
}

1.2.13  ViewResult

功能:表示一个类,该类用于使用由IViewEngine对象返回的IView实例来呈现视图。

(1)定义:

 public class ViewResult : ViewResultBase
{
// Fields
private string _masterName; // Methods
protected override ViewEngineResult FindView(ControllerContext context)
{
ViewEngineResult result = base.ViewEngineCollection.FindView(context, base.ViewName, this.MasterName);
if (result.View != null)
{
return result;
}
StringBuilder builder = new StringBuilder();
foreach (string str in result.SearchedLocations)
{
builder.AppendLine();
builder.Append(str);
}
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, MvcResources.Common_ViewNotFound, new object[] { base.ViewName, builder }));
} // Properties
public string MasterName
{
get =>
(this._masterName ?? string.Empty);
set
{
this._masterName = value;
}
}
}

1.2.14  PartialResult

功能:表示一个用于将分部视图发送到响应的基类。

(1)定义:

 public class PartialViewResult : ViewResultBase
{
// Methods
protected override ViewEngineResult FindView(ControllerContext context)
{
ViewEngineResult result = base.ViewEngineCollection.FindPartialView(context, base.ViewName);
if (result.View != null)
{
return result;
}
StringBuilder builder = new StringBuilder();
foreach (string str in result.SearchedLocations)
{
builder.AppendLine();
builder.Append(str);
}
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, MvcResources.Common_PartialViewNotFound, new object[] { base.ViewName, builder }));
}
}

2  ActionResult自定义扩展

关于ActionResult的自定义扩展,满足两个条件

(1)继承ActionResult

(2)重写ExecuteResult()方法

2.1  XMLResult

public class XmlResult : ActionResult
{
private object _data; public XmlResult(object data)
{
_data = data;
} public override void ExecuteResult(ControllerContext context)
{
var serializer = new XmlSerializer(_data.GetType());
var response = context.HttpContext.Response;
response.ContentType = "text/xml";
serializer.Serialize(response.Output, _data);
}
}

Controller

public XmlResult GetEmpInfo()
{
EmpInfo empInfo = new EmpInfo()
{
Name = "Alan_beijing",
Address = "China-ShangHai",
Age=
};
return new XmlResult(empInfo);
}

Test Result

2.2  CsvResult

 public class CsvResult : FileResult
{
private IEnumerable _data; public CsvResult(IEnumerable data, string fileName) : base("text/csv")
{
_data = data;
FileDownloadName = fileName;
} protected override void WriteFile(HttpResponseBase response)
{
var builder = new StringBuilder();
var strWriter = new StringWriter(builder); foreach (var item in _data)
{
var properties = item.GetType().GetProperties();
foreach (var prop in properties)
{
strWriter.Write(GetValue(item, prop.Name));
strWriter.Write(", ");
}
strWriter.WriteLine();
} response.Write(builder);
} public static string GetValue(object item, string propName)
{
return item.GetType().GetProperty(propName).GetValue(item, null).ToString() ?? "";
}
}

Controller

 public CsvResult DownCsvEmpInfo()
{
EmpInfo empInfo = new EmpInfo()
{
Name = "Alan_beijing",
Address = "China-ShangHai",
Age = 40
};
return new CsvResult(new List<EmpInfo>() { empInfo }, "empInfo");
}

测试结果

四   推荐网址

【01】https://msdn.microsoft.com/zh-cn/library/system.web.mvc.actionresult(v=vs.118).aspx

五  后续

敬请等待下一篇......

六  服务区

有喜欢的朋友,可以看一下,不喜欢的的朋友,勿喷,谢谢!!

【ASP.NET MVC系列】浅谈ASP.NET MVC八大类扩展(上篇)的更多相关文章

  1. MVC模式浅谈

    MVC模式浅谈 一.MVC模式概述 模型-视图-控制器(MVC模式)是一种非常经典的软件架构模式,在UI框架和UI设计思路中扮演着非常重要的角色.从设计模式的角度来看,MVC模式是 一种复合模式,它将 ...

  2. 【ASP.NET MVC系列】浅谈ASP.NET 页面之间传值的几种方式

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  3. 【ASP.NET MVC系列】浅谈ASP.NET MVC运行过程

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  4. 【ASP.NET MVC系列】浅谈ASP.NET MVC 视图

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  5. 【ASP.NET MVC系列】浅谈ASP.NET MVC 视图与控制器传递数据

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  6. 【ASP.NET MVC系列】浅谈ASP.NET MVC 控制器

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  7. 【ASP.NET MVC系列】浅谈ASP.NET MVC 路由

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  8. 【ASP.NET MVC系列】浅谈ASP.NET 程序发布过程

    ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...

  9. 浅谈ASP.NET ---- 系列文章

    [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作篇)(下) [04]浅谈ASP. ...

随机推荐

  1. 内存分配的原理__进程分配内存有两种方式,分别由两个系统调用完成:brk和mmap(不考虑共享内存)

    如何查看进程发生缺页中断的次数? 用ps -o majflt,minflt -C program命令查看. majflt代表major fault,中文名叫大错误,minflt代表minor faul ...

  2. (二十)即时通信的聊天气泡的实现I

    Tip:通过xib和storyboard不可能将一个控件作为ImageView的子控件,只能通过代码的addSubview方法实现. 设置图片的细节:如果button比图片大(为了方便对齐),将图片设 ...

  3. 学习OpenCV,GPU模块

    如何使用opencv的gpu库呢?我这两天一直在搞这个事情,环境的配置见上文(转载),这里我先举个简单的例子,实现这样的功能:host读入一幅图像,加载到GPU上,在GPU上复制一份然后下传到host ...

  4. HOW to Use QP_PREQ_PUB.PRICE_REQUEST API to Price an Item

    In this Document Goal   Solution   References APPLIES TO: Oracle Advanced Pricing - Version 11.5.10 ...

  5. 自动生成材质Material(Unity3D开发之十九)

    猴子原创,欢迎转载.转载请注明: 转载自Cocos2Der-CSDN,谢谢! 原文地址: http://blog.csdn.net/cocos2der/article/details/46854411 ...

  6. VT控制码

    VT100 是一个终端类型定义,VT100 控制码是用来在终端扩展显示的代码.比如果终端上任意坐标用 不同的颜色显示字符. 所有的控制符是 \033 打头(即 ESC 的 ASCII 码)用输出字符语 ...

  7. PS 滤镜算法原理——曝光过度

    这个算法的原理,就是将图像反相,然后分别比较原图与反相后的图三个通道的大小,将小的值输出. clc; clear all; Image=imread('4.jpg'); Image=double(Im ...

  8. HBase 索引创建

    本文参考了文"mysql索引背后的数据结构及算法原理",之所以还要摘录,主要是为了形成hbase索引研究的开篇,弄明白什么索引的本质,如有版权问题,请及时通知. 索引的本质 索引是 ...

  9. ruby rails_autolink不能加载的原因

    从rails 3.1.0开始,默认在ActionView::Helper::TextHelper中的auto_link方法已经被移除,放到了第三方的gem里:rails_autolink.遂想试一下其 ...

  10. 使用XStream是实现XML与Java对象的转换(4)--转换器

    七.转换器(Converter) 我们程序中的POJO是千变万化的,而且需求也是千奇百怪的,所以XStream中的内置的转换器的功能不一定能够满足我们的要求,所以我们就需要自己构建转换器. 1,一个基 ...