我用C#做了个网站,发布后,在IE浏览器里输入localhost/虚拟目录名可以访问,但是用IP/虚拟目录名进去,IE一下就自动关闭了,什么都没提示,请问各位大侠,这是什么问题,要怎么解决?
我用的是WINXP SP3+IIS5.1

解决方案 »

  1.   

    C:\WINDOWS\system32\drivers\etc下的hosts文件可能被改了,localhost 是不是127.0.0.1,
    如果是不是就改回来
      

  2.   


    # 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 host127.0.0.1       localhost没改
      

  3.   

    看系统日志;
     IIS日志;
    如果没有用信息;
    在程序中加入日志;
      

  4.   

    要用IP访问你的网站需要设置IIS,给网站标识添加的IP地址的记录,默认的的IP地址是127.0.0.1的,没有192.168.1.xxx这样的标识记录,参考
    如何使用本机IP地址访问网站
      

  5.   

    你要通过ip访问就得给你的iis绑定你的ip
      

  6.   

    你的iis里面有没有指定ip地址啊?
      

  7.   

    是不是路径问题?比如 我在本地的绝对路径是:D:\WebSite\Webs\
        虚拟目录的路径指向:D:\WebSite\Webs\
         而我们访问本地的路径http://localhost/webs/Default.aspx
        注意多个 webs 这个是文件夹名称
        如果你发布后,一般是直接是http://域名+Default.aspx