asp.netÍøÒ³¾²Ì¬»¯
Ò»¡£¢Ù£ºÊ×ÏÈÒªÓÐÕâ¸öÎļþURLRewriter.dll,Èç¹ûûÓÐ,¸Ï¿ìµ½ÍøÉÏÏÂÔØÒ»¸ö,²¢½«Æä·Åµ½ÏÂÃæµÄbinĿ¼ÀïÃæ,²¢ÇÒ½«ÆäÒýÓÃÌí¼Óµ½ÏÂÃæÀïÃæ;
¢Ú£ºÏÂÃæ¾ÍÊÇWeb.ConfigÎļþµÄÅäÖÃÁË,µ±È»,ÅäÖùý³ÌÏ൱¼òµ¥£º
1£ºÏÈÌí¼ÓÕâ¸ö
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Blog Content Displayer -->
<RewriterRule>
<LookFor>~/(.[0-9]*)\.html</LookFor>
<SendTo>~/ArticleDetail.aspx?MyID=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
2£ºÔÙÌí¼ÓÕâ¸ö
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
ÖÁ´Ë,Òѳɹ¦Ò»´ó°ë,ÉÏÃæÁ½¸ö¶¼Ìí¼Óµ½Web.Config,Ìí¼Óµ½Ê²Ã´Î»Öÿ´À´Ã»±ØÒª½²ÁË£¡
×îºóÒ»²½£ºÔÚIISÖÐÕÒµ½×Ô¼ºµÄÐéÄâĿ¼ÍøÕ¾,µãÊôÐÔ,È»ºóµãÅäÖÃ,È»ºóµ¯³öÓ¦ÓóÌÐòÅäÖöԻ°¿ò,Ñ¡ÔñÌí¼Ó,Ìí¼ÓµÄ¿ÉÖ´ÐÐÎļþ·¾¶Îªc:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll,À©Õ¹ÃûΪ.html£¨Èç¹ûÊÇÐéÄâÖ÷»ú£¬¿É¹ºÂòʹÓþÅÍø»¥ÁªµÄÖ÷»ú£¬¿ÉÖ±½ÓÔÚÏß²Ù×÷¿ªÍ¨Î±¾²Ì¬
¶þ¡£
view plaincopy to clipboardprint?
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
namespace Web.Admin
{
public partial class Admin_MakeIndex : System.Web.UI.Page
{
&n
Ïà¹ØÎĵµ£º
֮ǰҪÍê³ÉÒ»¸öÖ§³Ö¶àÖ§³Ö¶àÖÖ¸ñʽµÄÊÓƵ²¥·ÅÆ÷£¬ÔÚÍøÉÏÕÒµ½Ò»¸öVBдµÄ£¬È»ºó¸Ä³ÉC#£¬½ü¶ÎÔÚÍøÉÏÒ²¼ûÓв»ÉÙÈËÎÊÕâ¸öÎÊ£¬ÔÚ´Ë·ÖÏí
public class VideoPlayer
{
/// <summary>
/// Éú³ÉÊÓƵ²¥·ÅÆ÷µÄHTM ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="s ......
×î½üҪдһ¸öÔÚÍøÒ³ÖвéÕҹؼü×Ö¼°Á´½ÓµÄ³ÌÐò£¬ÔÚÊä³öµ½TextBoxµÄʱºò·¢ÏÖ¾³£³öÏÖÂÒÂ룬ÕûÀíÁËһϸù¾Ý²»Í¬µÄ±àÂëÑ¡È¡ÍøÒ³Ô´Îļþ£¬Ä¿Ç°¿ÉÒÔ½â¾ö¼¸ÖÖ³£±àÂ뷽ʽµÄÍøÒ³£¬¸ÐÐËȤµÄ¿ÉÒÔÊÔÏ¡£
±¾À´ÏëÓÓ£½£½”ÅжϱàÂ룬¸Ð¾õ±È½ÏÂé·³£¬ËùÒÔ¸ÄÓñȽÏÄ£ºýµÄ·½·¨£¬ContainsÓÃÔÚÕâÀïͦ·½±ãµÄ¡£
Contains˵Ã÷£º¾ÍÊÇ·µ» ......
ÆäʵËùνµÄα¾²Ì¬Ò³Ãæ,¾ÍÊÇÖ¸µÄURLÖØд.
1.Ê×ÏÈÔÚweb.configÀïд
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
2.ÔÚweb.configÀïÌí¼ÓÒÔϽڵã
<httpHandlers>
< ......