创建localhost以外的虚拟目录 [英] create a virtual directory other than the localhost

查看:51
本文介绍了创建localhost以外的虚拟目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在asp.net属性中是否有设置,您可以在其中将虚拟目录设置为您自己的IP地址而不是http:// localhost:61259 /,这样您就可以从不同的计算机访问您的Web应用程序使用iis?

解决方案

localhost 是环回地址以及 127.0.0.1 ,你可以用它的网络适配器的IP地址替换它。


你好,

这里是一个黑客或其他东西..

1.使用记事本打开项目文件。 (我使用notepad ++)。

2.找到IISUrl或'localhost'关键字。它应该是这样的:

 < iisurl> http:// localhost:61230 /< / iisurl>  



3.将localhost名称替换为您的IP地址。然后保存。

4.现在转到IIS Express的config文件夹。 (我的位于Documents> IISExpress> config)。

5.使用记事本打开applicationhost文件。

6.找到你的站点名称并在绑定下删除单词本地主机。像这样的东西

 < binding protocol =httpbindinginformation =*:61230:localhost/> - > < binding protocol =httpbindinginformation =*:61259:/>  



7.保存文件

8.关闭系统托盘中的IISExpress

9.以管理员身份运行Visual Studio



如果您在一个网站中查看您的网络应用程序浏览器你会看到地址栏中的localhost将被你的IP地址替换,你也可以从其他电脑上访问它。



希望这有帮助


Is there a setting in asp.net properties in which you can set the virtual directory to your own ip address other than "http://localhost:61259/" so you can access your web application from a different computer without the use of iis?

解决方案

localhost is the loopback address along with 127.0.0.1, you can replace it with the IP address of your network adapter for the machine.


Hi,
here's a hack or something..
1. Open your project file using a notepad. (I use notepad++).
2. Locate IISUrl or a 'localhost' keyword. It shoud be something like this:

<iisurl>http://localhost:61230/</iisurl>


3. Replace the localhost name to your ip address. Then save.
4. Now go to the config folder of your IIS Express. (mine is located in Documents > IISExpress > config).
5. Open applicationhost file using notepad.
6. Locate your site name and under bindings remove the word "localhost". Something like this

<binding protocol="http" bindinginformation="*:61230:localhost" /> --> <binding protocol="http" bindinginformation="*:61259:" />


7. Save the file
8. Close the IISExpress in the system tray
9. Run your Visual Studio as administrator

If you view your web app in a browser you'll see that the localhost in the address bar will be replaced by your ip address and you can access it also from other pc.

Hope this helps


这篇关于创建localhost以外的虚拟目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆