ASP概述_全解
- 格式:ppt
- 大小:2.46 MB
- 文档页数:121
MVC5基础-过滤器(Filters)详解什么是过滤器?通过上⼀篇关于Controller控制器的⽂章我们知道,MVC中的每⼀个请求,都会分配给相应的控制器(Controller)和对应的⾏为⽅法(Action)去处理,那么如果我们想要在Action处理的前后加上⼀些额外的处理逻辑怎么办呢?这时候就⽤到了过滤器(Filters)。
在 MVC的请求处理过程中有19个管道事件,这些事件分布在请求处理的各个节点中,⽐如BeginRequest(开始处理请求时触发)、AuthenticateRequest(对请求进⾏⾝份验证时触发)、AuthorizeRequest(对请求进程授权时触发)…等等等等。
⽽过滤器的主要作⽤就是将我们的附加逻辑注⼊到这些请求处理管道中。
在实际业务中,在Action⽅法前后添加额外附加逻辑的情况有很多,过滤器就是⽤来完成此功能。
通过过滤器可以将与业务逻辑⽆关但经常需要执⾏的代码分离开,使我们的代码逻辑性更加清晰,代码更加简洁。
过滤器的类型与作⽤MVC给我们提供了四种过滤器,基本满⾜了我们实际业务中常⽤的需求,包括以下:过滤器类型名称实现的接⼝默认的实现类作⽤执⾏的顺序与节点授权过滤器IAuthorizationFilter AuthorizeAttribute ⽤于限制进⼊控制器或控制器的某个⾏为⽅法在控制器⽅法调⽤前执⾏,所有过滤器中最先执⾏的动作过滤器IActionFilter ActionFilterAttribute⽤于进⼊动作⽅法之前或之后的处理在控制器⽅法调⽤前/后执⾏结果过滤器IResultFilter ActionFilterAttribute⽤于动作⽅法返回结果之前或之后的处理在控制器⽅法调⽤完,跳转⾄view页⾯前/后执⾏异常处理过滤器IExceptionFilter HandleErrorAttribute⽤于处理某个动作⽅法或某个控制器⾥⾯抛出的异常在控制器⽅法抛出异常时执⾏这四种类型的接⼝是MVC对过滤器的⼀个接⼝规范,同时MVC默认通过AuthorizeAttribute(授权)、HandleErrorAttribute(异常处理)、ActionFilterAttribute(动作和结果)三个类实现了这四个接⼝。
Core5-Kestrel源码解读上节讲到了kestrel服务器的配置及使⽤,相信很多同学已经对kestrel服务器有了初步的了解,那么有的同学可能会想更加深⼊的了解⼀下Kestrel服务器的是怎么实现监听和接收http请求的,今天我们来看下Kestrel服务器的源码,相信看完这些,你⼀定会对Kestrel服务器的运⾏机制有更深⼊的了解。
⾸先,让我们从程序启动类Program.cs开始分析。
public class Program{public static void Main(string[] args){CreateHostBuilder(args).Build().Run();}public static IHostBuilder CreateHostBuilder(string[] args) =>Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(webBuilder =>{eStartup<Startup>();});}其中,Host类链式调⽤了两个⽅法:CreateDefaultBuilderConfigureWebHostDefaults⾸先我们来看下CreateDefaultBuidler⽅法:public static IHostBuilder CreateDefaultBuilder(string[] args){HostBuilder hostBuilder = new HostBuilder();eContentRoot(Directory.GetCurrentDirectory());hostBuilder.ConfigureHostConfiguration((Action<IConfigurationBuilder>) (config =>{...}));hostBuilder.ConfigureAppConfiguration((Action<HostBuilderContext, IConfigurationBuilder>) ((hostingContext, config) =>{...})).ConfigureLogging((Action<HostBuilderContext, ILoggingBuilder>) ((hostingContext, logging) =>{...})).UseDefaultServiceProvider((Action<HostBuilderContext, ServiceProviderOptions>) ((context, options) =>{...}));return (IHostBuilder) hostBuilder;}}从上述代码可以看出,CreateDefaultBuilder并未涉及Kestrel服务器相关代码,仅仅是进⾏⼀些应⽤的初始化配置,例如,设置应⽤程序⽬录,设置配置⽂件等操作。
ASP 了解RecordSet对象
在数据库的访问中,使用Connection对象创建数据源的连接,通过Connection 的Execute方法以及Command对象和Parameter对象来完成数据库中记录添加、修改和删除功能。
ADO组件中的Recordset对象以及Field对象的主要功能是完成对数据库的查询,并提供了一种非常直观的操作方式。
在前面已经接触到了Recordset 对象,并对其有了一个初步的认识。
创建Recordset 对
象有显式和隐式两种方法。
通过Connection对象和Command 对象的Execute 等方法可以隐式创建Recordset对象。
在创建了Recordset对象后,就可以调用其属性、方法和集合,Recordset对象的属性如表9-4,方法如表9-5所示,集合如表9-6所示。
Recordset 对象是ADO组件中最灵活复杂也是最重要的一个对象,它对于数据的管理功能也是其他对象所无法比拟的。
虽然Recordset 对象的属性和方法很丰富,但是受篇幅所限,我们根据实践中的应用情况,在此仅对最常用的几种进行介绍。
带氨基和羧基的氨基酸-概述说明以及解释1.引言1.1 概述概述:氨基酸是构成蛋白质的基本组成单位,它们具有氨基和羧基两个功能团。
氨基酸可以通过连接氨基和羧基形成肽键,进而构成多肽链和蛋白质。
氨基酸在生物体内参与多种生物化学反应,如构建蛋白质、调节代谢和细胞信号传导等。
含氨基和含羧基的氨基酸是人体必需的营养物质,对维持生命活动和健康至关重要。
本文将从氨基酸的基本结构、含氨基的氨基酸和含羧基的氨基酸三个方面进行介绍,旨在深入探讨氨基酸的生物学功能和作用机制。
希望通过本文的阐述,读者能够加深对氨基酸这一重要生物分子的认识,并进一步了解其在生命活动中的重要作用。
1.2 文章结构本文主要分为引言、正文和结论三个部分。
在引言部分,将对带氨基和羧基的氨基酸进行概述,说明文章的目的,并介绍文章的结构。
正文部分包括三个小节,分别介绍氨基酸的基本结构、含氨基的氨基酸和含羧基的氨基酸。
在这部分将详细介绍不同种类的氨基酸的分子结构、性质和作用机制。
结论部分将总结本文的内容,探讨带氨基和羧基的氨基酸在生物学、医学等领域的意义与应用,并对未来的研究方向进行展望。
通过以上结构设计,旨在系统性地介绍带氨基和羧基的氨基酸的相关知识,使读者能够全面了解这一领域的内容,并为未来的研究提供参考和启发。
1.3 目的:本文的主要目的是探讨带有氨基和羧基的氨基酸在生物体内的重要作用和功能。
通过对氨基酸的基本结构、含氨基的氨基酸和含羧基的氨基酸进行详细的介绍和分析,旨在深入理解这些关键分子在蛋白质合成、细胞信号传导、代谢调节等方面的作用机制。
同时,本文将探讨氨基酸的多样性和功能差异,以期为进一步研究与应用提供理论基础和指导。
通过系统性地分析带有氨基和羧基的氨基酸在生物学中的重要性,有助于拓展我们对生命科学领域的认识,并促进相关领域的发展与进步。
2.正文2.1 氨基酸的基本结构氨基酸是构成蛋白质的基本单元,其分子结构包括一个氨基基团(NH2)和一个羧基(COOH)。
名词解释1.JavaScript : JavaScript是一种嵌入到HTML中脚本语言,它基于Java基本语句和控制流,以Java语言作为语法基础,与C语言的语法类似。
它在客户端的浏览器中执行,在执行过程中被浏览器逐步解释执行。
2.AJAX:是一种解决Web交互问题的技术。
即在Web应用程序中,仅对需要提交数据或者数据发生变化的局部页面实行刷新。
这种技术解决了Web应用程序中客户机与服务器的交互效率问题。
也成为无刷新Web页面。
3.嵌入式框架:嵌入式框架技术是网页设计中用于解决多页面、同结构问题的又一策略。
其基本思路是,在网页上开辟一个视窗,相对固定的信息的可以直接存放在页面上,而变化频繁的内容则由视窗实现。
在网页设计技术中,在网页中开辟的视窗占据网页中得一个区域,称为嵌入式框架。
4.ODBC:开放数据库互连(Open Database Connectivity,ODBC)是MICROSOFT 提出的数据库访问接口标准,开放服务结构中有关数据库的一个组成部分,它建立了一组规范,并提供了一组对数据库访问的标准API(应用程序编程接口)。
(网络)5.虚拟目录:理论上讲,开发者可以把自己开发的网页发布到服务器的任何文件夹中,但发布网页的文件夹必须统一接受IIS的管理,即发布网页的文件夹必须在逻辑上隶属于Web服务器,成为其管理下的一个目录。
为此,需要在Web服务器下做一个对实际文件夹的映射,这个映射就是虚拟目录。
6.样式:在网页设计中,为提高开发效率,人们通常若干个格式符组织在一起作为整体使用,这个整体通常被赋予一个独立的名称,这就是样式。
7.对象:在程序设计过程中,人们把这些包含动态属性和静态属性的客观事物统称为对象。
8.动态网页:所谓的动态网页,是指跟静态网页相对的一种网页编程技术。
静态网页,随着html代码的生成,页面的内容和显示效果就基本上不会发生变化了——除非你修改页面代码。
而动态网页则不然,页面代码虽然没有变,但是显示的内容却是可以随着时间、环境或者数据库操作的结果而发生改变的。
详解数据绑定操作中Repeater控件的⽤法⼀、绑定控件之Repeater.NET封装了多种数据绑定控件,诸如GridView、DataList等但该篇⽂章将会从Repeater⼊⼿,因为Repeater只提供了基本的数据绑定模板,没有内置其它分页等功能,所以它是最原始的数据绑定控件,只要能够熟练运⽤Repeater控件其它的绑定控件也就很简单了。
1、Repeater简介Repeater 控件是基本模板化数据列表。
它不像GridView控件⼀样能够可视化的设计格式或样式,因此开发时在控件模板中必须显式声明所有格式、格式和样式标记。
另外Repeater控件没有内置选择、排序、编辑、分页等功能,它只提供了基本的数据绑定,但是它为开发⼈员提供了ItemCommand 事件,该事件⽀持在控件中收发命令。
想要绑定数据,模板是必不可少的,Repeater控件同样⽀持数据模板,⽽且还可以在模板中添加想要的标签,它主要⽤法如下图:Note:每个 Repeater 控件必须定义 ItemTemplate。
⼆、控件使⽤技巧上⽂讲解了Repeater基本的使⽤⽅法及它的⼀些基本特性,接下来做⼏个经典的⽰例来运⽤Repeater控件。
1、数据绑定之删除、编辑该⽰例将会使⽤的前台和后台结合来实现显⽰数据,并能够编辑和删除数据。
删除页⾯:编辑页⾯:前台代码:在单击编辑按钮后将会进⼊编辑页⾯,页⾯是由两个Panel控件来控制,通过传递ID号的⽅式判断显⽰的是编辑页⾯还是删除页⾯,另外前台代码通过设置控件的CommandArgument属性来传递后台所需要判断的id号。
<body><form id="form1" runat="server"><div><asp:Repeater ID="userRepeat" runat="server" OnItemCommand="userRepeat_ItemCommand" OnItemDataBound="userRepeat_ItemDataBound"> <HeaderTemplate><table border="1" style="width:1000px;text-align:center;border-collapse:collapse;"><thead style="background-color:red;"><tr><th>ID</th><th>内容</th><th>操作</th></tr></thead></HeaderTemplate><ItemTemplate><asp:Panel ID="plItem" runat="server"><tr><td><asp:Label runat="server" ID="lblID" Text='<%#Eval("id") %>'></asp:Label></td><td><%#Eval("name") %></td><td><asp:LinkButton ID="lbtEdit" CommandName="Edit" CommandArgument='<%#Eval("id") %>' runat="server">编辑</asp:LinkButton><asp:LinkButton ID="lbtDelete" CommandName="Delete" CommandArgument='<%#Eval("id") %>' runat="server">删除</asp:LinkButton></td></tr></asp:Panel><asp:Panel ID="plEdit" runat="server"><tr><td><asp:Label runat="server" ID="Label1" Text='<%#Eval("id") %>'></asp:Label></td><td><asp:TextBox ID="txtName" runat="server" Text='<%#Eval("name") %>'></asp:TextBox></td><td><asp:LinkButton ID="lbtCancel" CommandName="Cancel" CommandArgument='<%#Eval("id") %>' runat="server">取消</asp:LinkButton> <asp:LinkButton ID="lbtUpdate" CommandName="Update" CommandArgument='<%#Eval("id") %>' runat="server">更新</asp:LinkButton> </td></tr></asp:Panel></ItemTemplate><FooterTemplate></table></FooterTemplate></asp:Repeater></div></form></body>后台代码:在后台代码中很重要的两个事件是ItemCommand和ItemDataBound,其中ItemCommand负责接收前台传进来的按钮命令,根据命令的参数来设置后台传递的id,并在ItemDataBound中来验证id判断切换显⽰Panel。
CoreEndPoint终结点路由⼯作原理解读⼀、背景在本打算写⼀篇关于Identityserver4的⽂章时候,却发现⾃⼰对EndPoint -终结点路由还不是很了解,故暂时先放弃了IdentityServer4的研究和编写;所以才产⽣了今天这篇关于EndPoint (终结点路由) 的⽂章。
还是跟往常⼀样,打开电脑使⽤强⼤的Google 和百度搜索引擎查阅相关资料,以及打开 core 3.1 的源代码进⾏拜读,同时终于在我的实践及测试中对EndPoint有了不⼀样的认识,说到这⾥更加敬佩微软对 core 3.x 的框架中管道模型的设计。
我先来提出以下⼏个问题:1. 当访问⼀个Web 应⽤地址时, Core 是怎么执⾏到Controller的Action的呢?2. EndPoint跟普通路由⼜存在着什么样的关系?3. UseRouting()、UseAuthorization()、UserEndpoints()这三个中间件的关系是什么呢?4. 怎么利⽤EndPoint终结者路由来拦截Action 的执⾏并且记录相关操作⽇志?(时间有限,下⼀篇⽂章再来分享整理)⼆、拜读源码解惑Startup代码我们先来看⼀下Startup中简化版的代码,代码如下:public void ConfigureServices(IServiceCollection services){services.AddControllers();}public void Configure(IApplicationBuilder app, IWebHostEnvironment env){eRouting();eAuthorization();eEndpoints(endpoints =>{endpoints.MapControllers();});}程序启动阶段:第⼀步:执⾏services.AddControllers()将Controller的核⼼服务注册到容器中去第⼆步:执⾏eRouting()将EndpointRoutingMiddleware中间件注册到http管道中第三步:执⾏eAuthorization()将AuthorizationMiddleware中间件注册到http管道中第四步:执⾏eEndpoints(encpoints=>endpoints.MapControllers())有两个主要的作⽤:调⽤endpoints.MapControllers()将本程序集定义的所有Controller和Action转换为⼀个个的EndPoint放到路由中间件的配置对象RouteOptions中将EndpointMiddleware中间件注册到http管道中eRouting()源代码如下:public static IApplicationBuilder UseRouting(this IApplicationBuilder builder){if (builder == null){throw new ArgumentNullException(nameof(builder));}VerifyRoutingServicesAreRegistered(builder);var endpointRouteBuilder = new DefaultEndpointRouteBuilder(builder);builder.Properties[EndpointRouteBuilder] = endpointRouteBuilder;return eMiddleware<EndpointRoutingMiddleware>(endpointRouteBuilder);}EndpointRoutingMiddleware中间件代码如下:internal sealed class EndpointRoutingMiddleware{private const string DiagnosticsEndpointMatchedKey = "Microsoft.AspNetCore.Routing.EndpointMatched";private readonly MatcherFactory _matcherFactory;private readonly ILogger _logger;private readonly EndpointDataSource _endpointDataSource;private readonly DiagnosticListener _diagnosticListener;private readonly RequestDelegate _next;private Task<Matcher> _initializationTask;public EndpointRoutingMiddleware(MatcherFactory matcherFactory,ILogger<EndpointRoutingMiddleware> logger,IEndpointRouteBuilder endpointRouteBuilder,DiagnosticListener diagnosticListener,RequestDelegate next){if (endpointRouteBuilder == null){throw new ArgumentNullException(nameof(endpointRouteBuilder));}_matcherFactory = matcherFactory ?? throw new ArgumentNullException(nameof(matcherFactory));_logger = logger ?? throw new ArgumentNullException(nameof(logger));_diagnosticListener = diagnosticListener ?? throw new ArgumentNullException(nameof(diagnosticListener));_next = next ?? throw new ArgumentNullException(nameof(next));_endpointDataSource = new CompositeEndpointDataSource(endpointRouteBuilder.DataSources);}public Task Invoke(HttpContext httpContext){// There's already an endpoint, skip maching completelyvar endpoint = httpContext.GetEndpoint();if (endpoint != null){Log.MatchSkipped(_logger, endpoint);return _next(httpContext);}// There's an inherent race condition between waiting for init and accessing the matcher// this is OK because once `_matcher` is initialized, it will not be set to null again.var matcherTask = InitializeAsync();if (!matcherTask.IsCompletedSuccessfully){return AwaitMatcher(this, httpContext, matcherTask);}var matchTask = matcherTask.Result.MatchAsync(httpContext);if (!matchTask.IsCompletedSuccessfully){return AwaitMatch(this, httpContext, matchTask);}return SetRoutingAndContinue(httpContext);// Awaited fallbacks for when the Tasks do not synchronously completestatic async Task AwaitMatcher(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task<Matcher> matcherTask) {var matcher = await matcherTask;await matcher.MatchAsync(httpContext);await middleware.SetRoutingAndContinue(httpContext);}static async Task AwaitMatch(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask){await matchTask;await middleware.SetRoutingAndContinue(httpContext);}}[MethodImpl(MethodImplOptions.AggressiveInlining)]private Task SetRoutingAndContinue(HttpContext httpContext){// If there was no mutation of the endpoint then log failurevar endpoint = httpContext.GetEndpoint();if (endpoint == null){Log.MatchFailure(_logger);}else{// Raise an event if the route matchedif (_diagnosticListener.IsEnabled() && _diagnosticListener.IsEnabled(DiagnosticsEndpointMatchedKey))// We're just going to send the HttpContext since it has all of the relevant information_diagnosticListener.Write(DiagnosticsEndpointMatchedKey, httpContext);}Log.MatchSuccess(_logger, endpoint);}return _next(httpContext);}// Initialization is async to avoid blocking threads while reflection and things// of that nature take place.//// We've seen cases where startup is very slow if we allow multiple threads to race// while initializing the set of endpoints/routes. Doing CPU intensive work is a// blocking operation if you have a low core count and enough work to do.private Task<Matcher> InitializeAsync(){var initializationTask = _initializationTask;if (initializationTask != null){return initializationTask;}return InitializeCoreAsync();}private Task<Matcher> InitializeCoreAsync(){var initialization = new TaskCompletionSource<Matcher>(TaskCreationOptions.RunContinuationsAsynchronously); var initializationTask = pareExchange(ref _initializationTask, initialization.Task, null);if (initializationTask != null){// This thread lost the race, join the existing task.return initializationTask;}// This thread won the race, do the initialization.try{var matcher = _matcherFactory.CreateMatcher(_endpointDataSource);// Now replace the initialization task with one created with the default execution context.// This is important because capturing the execution context will leak memory in Core.using (ExecutionContext.SuppressFlow()){_initializationTask = Task.FromResult(matcher);}// Complete the task, this will unblock any requests that came in while initializing.initialization.SetResult(matcher);return initialization.Task;}catch (Exception ex){// Allow initialization to occur again. Since DataSources can change, it's possible// for the developer to correct the data causing the failure._initializationTask = null;// Complete the task, this will throw for any requests that came in while initializing.initialization.SetException(ex);return initialization.Task;}}private static class Log{private static readonly Action<ILogger, string, Exception> _matchSuccess = LoggerMessage.Define<string>(LogLevel.Debug,new EventId(1, "MatchSuccess"),"Request matched endpoint '{EndpointName}'");private static readonly Action<ILogger, Exception> _matchFailure = LoggerMessage.Define(LogLevel.Debug,new EventId(2, "MatchFailure"),"Request did not match any endpoints");private static readonly Action<ILogger, string, Exception> _matchingSkipped = LoggerMessage.Define<string>( LogLevel.Debug,new EventId(3, "MatchingSkipped"),"Endpoint '{EndpointName}' already set, skipping route matching.");public static void MatchSuccess(ILogger logger, Endpoint endpoint)_matchSuccess(logger, endpoint.DisplayName, null);}public static void MatchFailure(ILogger logger){_matchFailure(logger, null);}public static void MatchSkipped(ILogger logger, Endpoint endpoint){_matchingSkipped(logger, endpoint.DisplayName, null);}}}我们从它的源码中可以看到,EndpointRoutingMiddleware中间件先是创建matcher,然后调⽤matcher.MatchAsync(httpContext)去寻找Endpoint,最后通过httpContext.GetEndpoint()验证了是否已经匹配到了正确的Endpoint并交个下个中间件继续执⾏!eEndpoints()源代码public static IApplicationBuilder UseEndpoints(this IApplicationBuilder builder, Action<IEndpointRouteBuilder> configure){if (builder == null){throw new ArgumentNullException(nameof(builder));}if (configure == null){throw new ArgumentNullException(nameof(configure));}VerifyRoutingServicesAreRegistered(builder);VerifyEndpointRoutingMiddlewareIsRegistered(builder, out var endpointRouteBuilder);configure(endpointRouteBuilder);// Yes, this mutates an IOptions. We're registering data sources in a global collection which// can be used for discovery of endpoints or URL generation.//// Each middleware gets its own collection of data sources, and all of those data sources also// get added to a global collection.var routeOptions = builder.ApplicationServices.GetRequiredService<IOptions<RouteOptions>>();foreach (var dataSource in endpointRouteBuilder.DataSources){routeOptions.Value.EndpointDataSources.Add(dataSource);}return eMiddleware<EndpointMiddleware>();}internal class DefaultEndpointRouteBuilder : IEndpointRouteBuilder{public DefaultEndpointRouteBuilder(IApplicationBuilder applicationBuilder){ApplicationBuilder = applicationBuilder ?? throw new ArgumentNullException(nameof(applicationBuilder));DataSources = new List<EndpointDataSource>();}public IApplicationBuilder ApplicationBuilder { get; }public IApplicationBuilder CreateApplicationBuilder() => ApplicationBuilder.New();public ICollection<EndpointDataSource> DataSources { get; }public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;}代码中构建了DefaultEndpointRouteBuilder终结点路由构建者对象,该对象中存储了Endpoint的集合数据;同时把终结者路由集合数据存储在了routeOptions中,并注册了EndpointMiddleware中间件到http管道中;Endpoint对象代码如下:/// <summary>/// Represents a logical endpoint in an application./// </summary>public class Endpoint{/// <summary>/// Creates a new instance of <see cref="Endpoint"/>./// </summary>/// <param name="metadata">/// The endpoint <see cref="EndpointMetadataCollection"/>. May be null./// </param>/// <param name="displayName">/// The informational display name of the endpoint. May be null./// </param>public Endpoint(RequestDelegate requestDelegate,EndpointMetadataCollection metadata,string displayName){// All are allowed to be nullRequestDelegate = requestDelegate;Metadata = metadata ?? EndpointMetadataCollection.Empty;DisplayName = displayName;}/// <summary>/// Gets the informational display name of this endpoint./// </summary>public string DisplayName { get; }/// <summary>/// Gets the collection of metadata associated with this endpoint./// </summary>public EndpointMetadataCollection Metadata { get; }/// <summary>/// Gets the delegate used to process requests for the endpoint./// </summary>public RequestDelegate RequestDelegate { get; }public override string ToString() => DisplayName ?? base.ToString();}Endpoint对象代码中有两个关键类型属性分别是EndpointMetadataCollection类型和RequestDelegate:EndpointMetadataCollection:存储了Controller和Action相关的元素集合,包含Action上的Attribute特性数据等RequestDelegate:存储了Action 也即委托,这⾥是每⼀个Controller 的Action ⽅法再回过头来看看EndpointMiddleware中间件和核⼼代码,EndpointMiddleware的⼀⼤核⼼代码主要是执⾏Endpoint 的RequestDelegate委托,也即Controller中的Action的执⾏。
动态网页设计——习题和实训参考答案第1章概述1第2章HTML语言根底2第3章语法根底3第4章效劳器控件6第5章验证控件7第6章常用置对象9第7章访问数据库10第8章开发实训12第1章概述实训:本章的实训容主要是建立的运行和编辑环境。
具体包括以下几项任务:1、建立以各自名字命名的文件夹,作为本课程学习目录2、安装IIS,安装完后在IE中输入localhost,看能否翻开欢送页面,检测是否安装成功。
localhost也可用“127.0.0.1”代替。
答:安装IIS的步骤详见教材P5。
3、建立一个虚拟目录,以第1步建立的文件夹为物理目录,虚拟目录名用的拼音答:建立虚拟目录的步骤详见教材P8.4、建立.NET运行环境(1)下载和安装MDAC答:MDAC的安装详见教材P10。
(2)下载和安装.NET Framework 1.1版可发行组件包答:.NET Framework 1.1版可发行组件包的安装详见教材P11。
5、安装Dreamweaver 8答:Dreamweaver 8的安装详见教材P14。
6、在Dreamweaver 8中建立站点答:Dreamweaver 8中建立站点的步骤详见教材P18。
习题:1、解释动态网页和静态网页的含义。
在网页中插入动画或影视媒体是否就称其为动态网页?答:根据网页的容是固定的还是程序生成的,网页分为两种:静态网页和动态网页。
这两种网页的制作语言不同。
静态网页使用语言是HTML(超文本标记语言),网页的容是事先编制好的。
动态网页的网页容不是固定不变的,而是由程序动态创立的。
根据实现技术,动态网页又可以细分为客户端动态网页和效劳器端动态网页。
在网页中插入动画或影视媒体并不是动态网页。
2、ASP与有什么不同?答:与ASP有很大的不同。
ASP程序是解释执行,未经优化;而是编译执行,程序效率得到提高。
在第一次访问网页时,由于需要编译,因此,在第一次连接访问时,网页的连接速度比ASP网页慢。