web应用开发访问地址个性化设置

      我们平时用asp.net开发web应用,vs会给我们生产一个临时的iis虚拟地址如:http://localhost:4626/ (NND,真难看),还得每次调试启动才能访问,真的是很麻烦。有没有一种办法可以直接访问我们当前的web应用,并与不断增加的开发文件同步呢,答案是肯定的。

      我们可以把当前开发的web程序,如http://localhost:4626/ 修改为 http://long.dev并且不必启动调试,即可实时与不断修改添加的开发文件同步。

      效果如下:

     

(- -!我现在是xp系统)步骤:

第一步:

通过地址栏访问:C:\WINDOWS\system32\drivers\etc 找到hosts文件,然后右键记事本打开(记得备份),格式如下:

# copyright (c) 1993-1999 microsoft corp.
#
# this is a sample hosts file used by microsoft tcp/ip for windows.
#
# this file contains the mappings of ip addresses to host names. each
# entry should be kept on an individual line. the ip address should
# be placed in the first column followed by the corresponding host name.
# the ip address and the host name should be separated by at least one
# space.
#
# additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# for example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
# 以下都是在2006-2007年恶意修改IE属性,或者传播病毒或者木马的网站
127.0.0.1       localhost
127.0.0.1 858656.com

在最后一行添加如:  127.0.0.1  long.dev

然后保存,好了这一步完成了。

第二步:

       

打开控制面板》管理工具》Internet 信息服务  修改上面红圈的地址 指向为你当前开发web的文件夹。然后增加此Web文件夹的权限(zak.web),然后访问long.dev即可向我上面一样。这样来开发会提高很大的效率,不用启动调试即可实时访问更新文件。更重要的 个性化的访问地址。

 

下面你也来试试吧!

 

posted @ 2009-12-25 00:07  funnyzak  阅读(476)  评论(2编辑  收藏  举报