显示标签为“IIS7”的博文。显示所有博文
显示标签为“IIS7”的博文。显示所有博文

2009年3月1日星期日

March 2th-6th Links:Design Patterns,Observer Pattern,Decorator Pattern

ASP.NET

ASP.NET MVC

c#
    2. Snippet: Check for Internet Connectivity(c#)
    WHAT IS AN INTERFACE?
    Interface is a contract that implementer must follow.In other words,an interface says what class must defined.Importantly,an interface doesn't specify(or care) how the implemention is actually achieved. As we move forward we'll see how helpful this can be to us.
    An interface can define zero or more members(methods or propties) and a class can implement zero or more interface.Interface members always have public.An interface with zero member is called marker-interface,they don't require implementer to do anything.
    An raise exist of interface is to provide developers with a language-level tool that allows classes to be decoupled from each other.

Design Patterns
    The decorator pattern can be used to make it possible to extend (decorate) the functionality of a class at runtime.
    

Web

English
    1. legacy: 继承,遗产
    2. merciless: 殘忍的
    3. pair with: 搭配
    4. violation: 违反,违背
    5. proper: 适当的,正确的
    6. crucial: 关键的,决定性的
    7. snippet: 小片,片段
    8. badminton: 羽毛球
    9. decouple:
    10. overlap: 重叠

2008年10月13日星期一

IIS7 地址重写模块(ASP.NET and the new IIS7 Rewrite Module)

在上一年,我注意到这里有11个方式能进入到我的blog。准备的说是11个不同的url,但它并不能帮助我在搜索引擎中提高排名。
在最新版的ISAPI_Rewrite和Apache's standard mod_rewrite模块中都使用了分离的configuration 文件或.htaccess文件。
下面是我.htaccess文件的一部分,它确认所以进来的URLs都结束于最后的链接http://www.hanselman.com/blog/:

RewriteRule /blog/default\.aspx http\://www.hanselman.com/blog/ [I,RP] 
RewriteCond Host: ^hanselman\.com
RewriteRule (.*) http\://www.hanselman.com$1 [I,RP]

RewriteCond Host: ^computerzen\.com
RewriteRule (.*) http\://www.hanselman.com$1 [I,RP]

RewriteCond Host: ^www.computerzen\.com
RewriteRule (.*) http\://www.hanselman.com/blog/ [I,RP]
在你安装了IIS7 Rewrite module后,你能以两个方式输入url规则。最好的方式是真接的导入他们。注意这种输入文件的规则必须是被mod_rewrite语法所知道的规则。它并不完全的支持ISAPI_Rewrite。例如Host:[I]不被支持在这次的发布的版本中,但是我希望在最终的RTW版本能支持它们。如果你有ISAPI_Rewrite规则,你可以手动的转换整理它们。
例如,在rule输入界面里,我替换ISAPI_Rewrite指令“Host:"用"&{HTTP_HOST}代替,[I]用[NC](不区分大小写)等等。
image
这是一种有用的导入规则的方法,但是处理起来有时候比较困难。另外还有一种添加规则的方法
Add rule(s)
这是一种非常简单的方法,通过提供了一个友好的交互式窗口,用于创建应用程序URL和你想要的URL之间的映射,如下图所示
Add rules to enable user friendly URLs (2)