国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

UrlRewritingNet.UrlRewrite 中文文檔

2019-11-06 06:39:49
字體:
來源:轉載
供稿:網友

Installation of UrlRewritingNet.UrlRewrite安裝UrlRewritingNet.UrlRewriteSystem requirements 系統要求UrlRewritingNet.UrlRewrite is running on each Web server which is running asp.net 2.0.UrlRewritingNet.UrlRewrite 可以在任何一個運行asp.Net 2.0的web服務器上運行。 Tested Web server with UrlRewritingNet.UrlRewrite:被UrlRewritingNet.UrlRewrite測試過web服務器:   IIS 5.0   IIS 5.1   IIS 6.0   Visual Studio 2005 WebDev Server   IIS 5.0   IIS 5.1   IIS 6.0   Visual Studio 2005 WebDev ServerWe didn't test it with Mono.InstallationTo install UrlRewritingNet.UrlRewrite you have to follow these easy steps:

1.  Installation of the Assembly  ".dll"2.  Installation of the configuration schema 3.  Setting up the configuration settings area in the Web.config 4.  Embedding UrlRewritingNet as Http Module  安裝為了安裝UrlRewritingNet.UrlRewrite,你不得不按照下面幾個簡單的步驟:1.“.dll”組件的安裝。2.配置模式的安裝。3.在web.config中設置配置。4.將UrlRewritingNet作為Http Module嵌入。Installation of the Assembly Just copy UrlRewritingNet.UrlRewriter.dll in your web applications /bin folder. 安裝組件只需要拷貝UrlRewritingNet.UrlRewriter.dll在你的web應用程序/Bin目錄。Installation of the configuration schema To get IntelliSense support just copy the file urlwritingnet.xsd in you web application (wherever you want). If you web application is part of a solution, you can also put the file anywhere in the solution. 配置模式的安裝為了得到智能提示的支持,只需要拷貝urlwritingnet.xsd文件到你的web應用程序中(無論什么位置)。如果你的web應用程序是解決方案的一部分,你也可以把這個文件放在解決方案中的任何一個地方。Setting up the configuration settings area in the Web.config To get the configuration settings from the web.config this area has to be advertised. Just replace the <configSections> if exists.在web.config中設置配置為了從web.config中得到配置設置,這個區域必須被告知。如果<configSections>存在則替換它。<configuration>   <configSections>     <section name="urlrewritingnet"                restartOnExternalChanges="true"              requirePermission ="false"               type="UrlRewritingNet.Configuration.UrlRewriteSection,                    UrlRewritingNet.UrlRewriter"  />   </configSections> </configuration>If the area is advertised, just create it.如果這個區域被占用,就創建它。  <urlrewritingnet       xmlns="http://www.urlrewriting.net/schemas/config/2006/07" >   </urlrewritingnet> This section has to be placed in <configuration /> but after <configSections />. Do not place this in <appSettings /> or <system.web>! Fo example se the sample web application. To get IntelliSense  support you have to add "xmlns" attribute.這部分不需安置在<configuration />的內部<configSections />之后。不要安置在<appSettings />或者<system.web>中!例如示例web應用程序.為了得到智能提示支持,你不得不添加"xmlns"屬性。Embedding UrlRewritingNet as HttpModul To handle all incoming requests with UrlRewritingNet you have to register the component as Http Module in the <system.web /> section in Web.config. 將UrlRewritingNet作為Http Module嵌入用UrlRewritingNet處理所有的鏈入請求,你不得不在<system.web />片段中將組件注冊成為Http Module。<system.web>     <httpModules>      <add name="UrlRewriteModule"          type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />     </httpModules>       </system.web> Now UrlRewritingNet configuration is complete.現在UrlRewritingNet配置完畢。Necessary changes by upgrading from 1.1 to 2.0 By upgrading from 1.1 to 2.0 you have to change a little bit on your existing configuration. 1.  All rules need a unique name. 2.  Don't use the attribute "compileRegEx" anymore.3.  Refresh configuration schema If one of these requirements is not given, the application throws exceptions. 從1.1升級到2.0需要做的一些改變從1.1升級到2.0你不得不改變一些已經存在的配置。1.所有的規則都需要獨一無二的name.2.不要再使用"compileRegEx" 屬性。3.刷新配置模式。如果其中一條要求沒有滿足,則程序會拋出異常。Give your rules unique names All existing (and of course new) rules have to get unique names. This is necessary to change them on runtime. Old rule entry:       <add virtualUrl="^~/girls/(.*)/(.*).aspx"                        rewriteUrlParameter="ExcludeFromClientQueryString"             destinationUrl="~/Default.aspx?name=$1&amp;show=$2"            ignoreCase="true" /> New rule entry:       <add name="Gallery"              virtualUrl="^~/girls/(.*)/(.*).aspx"                        rewriteUrlParameter="ExcludeFromClientQueryString"             destinationUrl="~/Default.aspx?name=$1&amp;show=$2"            ignoreCase="true" /> 給你的規則添加獨一無二的名字。所有存在的規則都需要一個獨一無二的名字。這個些改變是讓他們運行環境所必要的。舊規則:       <add virtualUrl="^~/girls/(.*)/(.*).aspx"                        rewriteUrlParameter="ExcludeFromClientQueryString"             destinationUrl="~/Default.aspx?name=$1&amp;show=$2"            ignoreCase="true" /> 新規則:       <add name="Gallery"              virtualUrl="^~/girls/(.*)/(.*).aspx"                        rewriteUrlParameter="ExcludeFromClientQueryString"             destinationUrl="~/Default.aspx?name=$1&amp;show=$2"            ignoreCase="true" />Remove "compileRegEx" attribute The attribute "compileRegEx" has been obsolete. So please remove it from all entries and the <urlrewritingnet />  configuration area. 移除"compileRegEx"屬性"compileRegEx"屬性已經廢除。所以請將它從所有的<urlrewritingnet />配置區域內移除。Refresh configuration schema For getting IntelliSense support you have to update the namespace to the current version.   <urlrewritingnet     xmlns="http://www.urlrewriting.net/schemas/config/2006/07" > And of course you have to replace the existing urlrewritingnet.xsd with the new one.刷新配置模式為了得到智能提示,你不得不更新namespace(命名空間)而得到正確的版本。<urlrewritingnet     xmlns="http://www.urlrewriting.net/schemas/config/2006/07" > 并且你當然可以用一個新的urlrewritingnet.xsd替換已經存在的這個文件。Configuration von UrlRewritingNet.UrlRewrite is configured in the area in Web.config which you set up during the installation (see page 8). Here a little sample:   <urlrewritingnet     rewriteOnlyVirtualUrls="true"        contextItemsPRefix="QueryString"      defaultPage = "default.aspx"     xmlns="http://www.urlrewriting.net/schemas/config/2006/07" >     <providers>       <add name="MyGreatProvider" type="MyApp.Web.MyGreatProvider, MyGreatProvider.dll"/>     </providers>     <rewrites>       <add name="Rule1"  virtualUrl="^~/(.*)/Detail(.*).aspx"                        rewriteUrlParameter="ExcludeFromClientQueryString"             destinationUrl="~/Default.aspx?language=$1&amp;id=$2"            ignoreCase="true" />       <add name="Rule2"              provider="MyGreatProvider"            myattribute="/foo/bar/dhin.aspx"             rewriteUrlParameter="ExcludeFromClientQueryString"             rewrite="Domain"             ignoreCase="true" />     </rewrites>   </urlrewritingnet> This configuration can become very comprehensive, so you can swap it out into an external config file. Please use the configSource attribute for that:   <urlrewritingnet configSource="ExternalRewrite.config" /> In ExternalRewrite.config you have to put the complete configuration area. 配置UrlRewritingNet.UrlRewrite家族已經被我們配置在上一節所說的web.config文件中。這兒有一個簡單的例子:<urlrewritingnet     rewriteOnlyVirtualUrls="true"        contextItemsPrefix="QueryString"      defaultPage = "default.aspx"     xmlns="http://www.urlrewriting.net/schemas/config/2006/07" >     <providers>       <add name="MyGreatProvider" type="MyApp.Web.MyGreatProvider, MyGreatProvider.dll"/>     </providers>     <rewrites>       <add name="Rule1"  virtualUrl="^~/(.*)/Detail(.*).aspx"                        rewriteUrlParameter="ExcludeFromClientQueryString"             destinationUrl="~/Default.aspx?language=$1&amp;id=$2"            ignoreCase="true" />       <add name="Rule2"              provider="MyGreatProvider"            myattribute="/foo/bar/dhin.aspx"             rewriteUrlParameter="ExcludeFromClientQueryString"             rewrite="Domain"             ignoreCase="true" />     </rewrites>   </urlrewritingnet>這個配置文件已經非常全面了。所以,你可以將這段安置在你的擴展config文件中。請使用configSource(配置源)屬性:<urlrewritingnet configSource="ExternalRewrite.config" />在 ExternalRewrite.config你不得不使用全部的配置。Attributes for <urlrewritingnet /> rewriteOnlyVirtualUrls                         true, false (Standard: true)                         Prevents rewriting for real existing files on the server if true. contextItemsPrefix                         String                         If the Query String parameters should putted down in                                                       HttpContext.Current.Items[], you can define a prefix, which will be                                     inserted  before the parameters name with a point after.  defaultProvider                         ProviderName (Standard: RegEx)                         Name of the default Rewrite Provider used if no other is assigned.defaultPage                         Dateiname                         Name of the default page which is used on access without file extension                             (see page 6, working without file extension). <urlrewritingnet /> 屬性rewriteOnlyVirtualUrls                         true, false (Standard: true)                         如果為真則防止重寫真實存在的文件。 contextItemsPrefix                         String                         假設這個請求字符參數被寫入在HttpContext.Current.Items[]中,                                            你可以定義一個前綴,以"."結尾插入在這個參數的前面 defaultProvider                         ProviderName (默認: RegEx)                         如果沒有其他的指派,這個名字將用默認的重寫驅動。defaultPage                         Dateiname                         用于存取沒有擴展名的默認頁面名稱(見6頁, 無擴展名工作).The  <providers /> listing Here can the custom providers be added. Fore more information see "Page 19" Embedding the provider in the web.config" and the documentation of the specific provider.<providers />列表自定義的providers(驅動)添加。更多信息見19頁"在web.config文件中嵌入驅動"和特別provider(驅動)文檔。The <rewrites /> listing Here can the rewrite rules be added. The rules are processed from up to down, the first matching rule is used for the rewriting and the process is being ready (no more rule will be processed). To add a new rule just type a new <add /> element, IntelliSense will present you the available attributes which are listed below. name Name of the rule                         A free selectable name of the rule which has to be unique. With this name                         (ID) you can                         do some magic with this rule programmatically, too (see page 16) provider ProviderName                        Name of the used provider. If no one is selected, the default provider will                             be  used. redirect                         None, Application, Domain (Standard: None)                         To make a redirect instead of a rewrite. None    Normal rewrite Application   Redirect within your web application Domain   Redirect to another domain which has to be part of                                             the destinationUrl redirectModePermanent, Temporary (Standard: Temporary)                         Here you can select of which type your redirect is  permanent (HTTP status                         code 301) or temporary (HTTP status code 302). If you want to transfer a                         website from onerewrite Application, Domain (Standard: Application)                         Defines whether the domain has to be included in the process or not. rewriteUrlParameter ExcludeFromClientQueryString,                        StoreInContextItems ,                        IncludeQueryStringForRewrite                         (Standard: ExcludeFromClientQueryString) ExluceFromClientQueryStringIn Request.QueryString[] all parameters are available. In                                                     Page.ClientQueryString are only the parameters added, which are visible in                         the browsers address field, so a postback is possible. Parameters added in                         destinationUrl are not added in Page.ClientQueryString.StoreInContextItems                         All parameters listed in the Url field of the browser and the parameters from                         the rewrite are added in HttpContext.Current.Items[] too, prefixed by a                             string defined in contextItemsPrefix. IncludeQueryStringForRewrite                         Include the full Query String (the parameters in the browsers address field)                         in the rewrite process, so that they can be handled by the engine. 

As a developer of a rewrite provider you should look to develop your provider meeting the standard behavior, but of course  it can vary. <rewrites />列表在這里添加重寫規則。規則被從上到下的處理,第一條匹配的規則將被處理并且加入處理隊列(其他規則將不被處理)。加入一條新規則只需要添加<add />元素標簽。智能提示將為你呈現下面列出的有效屬性。name 規則的名稱                         一個可以自由選擇的但是必須唯一的名字,使用這個名字(ID)你也可以通過具有編程                        性的規則做一些變化(見16頁) provider ProviderName(驅動名稱)                         Name of the used provider. If no one is selected, the default provider will                             be  used. redirect                         None, Application, Domain (Standard: None)                         設置一個跳轉代替重寫。 None    普通重寫Application   在你的web應用程序中跳轉。 Domain   跳轉到另外一個必須包含目標Url的域名上。 redirectModePermanent(永久), Temporary(暫時) (默認: Temporary)                         這里,你可以選擇你的跳轉類型為永久(HTTP 狀態代碼301)或者暫時(HTTP狀態代碼302)。如果你想從另外一個網站遷移。rewrite Application(應用程序), Domain(域名) (默認: Application)                         定義域名是否必須包含在進程中。 rewriteUrlParameter ExcludeFromClientQueryString,                        StoreInContextItems ,                        IncludeQueryStringForRewrite                         (默認: ExcludeFromClientQueryString) ExluceFromClientQueryStringIn Request.QueryString[] 所有的參數都是有效的,只有在瀏覽器地址欄看到的                             Page.ClientQueryString 參數被添加的時候,  PostBack 才會有效。參數加在                                dstinationUrl 而不是添加在Page.ClientQueryString.StoreInContextItems                         所有的參數被羅列在瀏覽器的url和重寫規則HttpContext.Current.Items[]參數中,                        這些被預定義在contextItemPrefix字符串中。IncludeQueryStringForRewrite                         在重寫隊列中包含所有的查詢字符串(在瀏覽器Url地址欄里的參數)所以你可以使用引                        擎(UrlRewritingNet.UrlRewrite)處理它們。作為一個重寫驅動的開發者,你應該使得你開發的驅動能夠符合標準的行為,當然,也可以有不同。

RegEx Rewrite Attributes Our standard provider has the following attributes. virtualUrl                         regular expression                         A regular expression which is used for replacing the current Url with                                     destinationUrl. destinationUrl                         regular expression replacement term                         A regular expression term describing the target page (physical file). regexOptions                        Multiline, ExplicitCapture, Singleline, IgnorePatternWhitespace, RightToLeft,                         ECMAScript, CultureInvariant                         For an optimal control over the regular expressions you can add additional                         to ignoreCase here some RegexOptions. But this is only necessary in special                         cases. For more information see the Microsoft MSDN documentation. 屬性:正則重寫我們標準的驅動支持下列屬性:virtualUrl                         正則表達式                         一條用于替換真實Url的最終Url正則表達式。destinationUrl                         正則表達式替換的區域限制                         一條正則表達式限制描述的目標頁面(物理文件)regexOptions                        多行模式,明確的抓取,單行,忽略空格,從右到左,ECMAScript,CultureInvariant                         為了得到最佳的通過正則控制的設置,你也可以添加附加的忽略正則選項。但是這只適                        合特別需要的地方。更多的信息見MSND文檔。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 开封市| 巩留县| 丁青县| 宁远县| 中西区| 屯昌县| 独山县| 汶上县| 澎湖县| 六枝特区| 蕲春县| 兰西县| 于田县| 谷城县| 台前县| 陕西省| 泸水县| 滁州市| 盐池县| 凌源市| 武川县| 车险| 贵定县| 广河县| 边坝县| 通道| 健康| 德昌县| 普兰店市| 应用必备| 嵊泗县| 蛟河市| 林口县| 焉耆| 来安县| 云安县| 上林县| 盐城市| 武山县| 应城市| 静宁县|