English 中文(简体)
如何通过局域网访问ASP.NET网站[已关闭]
原标题:
  • 时间:2009-03-14 17:52:37
  •  标签:
Closed. This question is off-topic. It is not currently accepting answers.

想要改进这个问题吗?更新问题,使其符合Stack Overflow的主题

Closed 9 years ago.

我有一个asp.net网页应用程序,我希望它可以通过本地区域网络(LAN)或无线局域网(WLAN)访问。

我不知道从哪里开始。有没有一些配置需要我做才能让别人访问我的网页?

我非常感激您的回答,非常感谢。(^_^)…

最佳回答

I m not sure how stuck you are:

You must have a web server (Windows comes with one called IIS, but it may not be installed)

  1. Make sure you actually have IIS installed! Try typing http://localhost/ in your browser and see what happens. If nothing happens it means that you may not have IIS installed. See Installing IIS
  2. Set up IIS How to set up your first IIS Web site
  3. You may even need to Install the .NET Framework (or your server will only serve static html pages, and not asp.net pages)

Installing your application

Once you have done that, you can more or less just copy your application to C:inetpubwwwroot. Read Installing ASP.NET Applications (IIS 6.0) for more information

Accessing the web site from another machine

In theory, once you have a web server running, and the application installed, you only need the IP address of your web server to access the application.

To find your IP address try: Start -> Run -> type cmd (hit ENTER) -> type ipconfig (hit ENTER )

Once

  • you have the IP address AND
  • IIS running AND
  • the application is installed

you can access your website from another machine in your LAN by just typing in the IP Address of you web server and the correct path to your application.

If you put your application in a directory called NewApp, you will need to type something like http://your_ip_address/NewApp/default.aspx

Turn off your firewall

If you do have a firewall turn it off while you try connecting for the first time, you can sort that out later.

问题回答

You may also need to enable the World Wide Web Service inbound firewall rule.

On Windows 7: Start -> Control Panel -> Windows Firewall -> Advanced Settings -> Inbound Rules

Find World Wide Web Services (HTTP Traffic-In) in the list and select to enable the rule. Change is pretty much immediate.

You will need to configure you IIS (assuming this is the web server your are/will using) allowing access from WLAN/LAN to specific users (or anonymous). Allow IIS trought your firewall if you have one.

Your application won t need to be changed, that s just networking problems ans configuration you will have to face to allow acces only trought LAN and WLAN.

If you use IIS Express via Visual Studio instead of the builtin ASP.net host, you can achieve this.

Binding IIS Express to an IP Address





相关问题
热门标签