IIS Express 比 IIS更好用,轻量级服务器(IIS精简版),貌似默认支持asp和asp.net,对.net的支持也可以在“控制面板”的“程序与功能”中添加
安装完毕后用命令行工具(iisexpress.exe)运行服务器,配置文件存放在(C:\Program Files\IIS Express\config)
PS C:\Program Files\IIS Express> .\iisexpress.exe /? IIS Express Usage: ------------------ iisexpress [/config:config-file] [/site:site-name] [/siteid:site-id] [/systray:true|false] [/trace:trace-level] [/userho me:user-home-directory] iisexpress /path:app-path [/port:port-number] [/clr:clr-version] [/systray:true|false] [/trace:trace-level] /config:config-file The full path to the applicationhost.config file. The default value is the IISExpress\config\applicationhost.config file that is located in the user's Documents folder. /site:site-name The name of the site to launch, as described in the applicationhost.config file. /siteid:site-id The ID of the site to launch, as described in the applicationhost.config file. /path:app-path The full physical path of the application to run. You cannot combine this option with the /config and related options. /port:port-number The port to which the application will bind. The default value is 8080. You must also specify the /path option. /clr:clr-version The .NET Framework version (e.g. v2.0) to use to run the application. The default value is v4.0. You must also specify t he /path option. /systray:true|false Enables or disables the system tray application. The default value is true. /userhome:user-home-directory IIS Express user custom home directory (default is %userprofile%\documents\iisexpress). /trace:trace-level Valid values are 'none', 'n', 'info', 'i', 'warning', 'w', 'error', and 'e'. The default value is none. \Examples: iisexpress /site:WebSite1 This command runs WebSite1 site from the user profile configuration file. iisexpress /config:c:\myconfig\applicationhost.config This command runs the first site in the specified configuration file. iisexpress /path:c:\myapp\ /port:80 This command runs the site from the 'c:\myapp' folder over port '80'.
启动方法如下:
.\iisexpress.exe /path:"C:\Users\Ciaos\Documents\My Web Sites\WebSite1" /port:80
配置端口及外网访问
编辑C:\Users\Ciaos\Documents\IISExpress\config <binding protocol="http" bindingInformation=":8080:localhost" /> 修改为 <binding protocol="http" bindingInformation="*:80:*" /> 外网可以通过ip直接访问
一个典型的asp.net页面(.aspx)结构如下(IIS默认vb.net)
<% Page Language="VB" %>
<html>
<body>
<form runat="server">
Enter you hobby:
<asp:TextBix id="txtHobby" runat="server"/
>
<input type="submit">
</form>
</body>
<script runat="server>
Sub Page_Load(…, …)
… …
End Sub
</script>
<script lanuguage="javascript">
function --- ----
{ ---
}
</script>
</html>
更多资料参照:http://www.cnblogs.com/IPrograming/archive/2013/05/26/Configuration_IIS_Express.html