IIS publishes asp.net web site
When learning Android, because you did not learn to use JSP to build the site backstage, you need to use ASP.net to write a Web site background program to respond to the app's network request. Because ASP.net and Android localhost are not the same, can not access each other, local debugging is very inconvenient, Bo main intelligence through the mobile phone to connect Wi-Fi way to share the local area network.
Here's a simple example of how to use IIS to publish a Web site. (VS2015)
1. Write a simple ASPX daemon with the following code:
public partial class _default:system.web.ui.page
{
protected void Page_Load (object sender, EventArgs e)
{ C4/>if (request.params["username"] = = "Hugh" && request.params["age"] = = "a")
{
Response.Write ("Ture ");
}
else
{
Response.Write ("false");
}
}
2. After the successful commissioning, right key project name, select "Publish Web Application", directly on the map, the final direct release can be.
3. Search IIS directly with Natalie and open, above.
4. Add "Default document", preferably enable "directory browsing." If you open the default document error, be aware that the Default.aspx is set as the default page in the Web.config file, and if it is already set, annotate it, as shown in the following code example
<?xml version= "1.0"?>
<!--
For more information about how to configure the ASP.net application, visit
http://go.microsoft.com/fwlink/? linkid=169433
-->
<configuration>
<system.web>
<compilation targetframework= " 4.5.2 "debug=" true "/>
5. online Basic To this step is no one to teach, but most people still can not normally visit their website, error 400,500, and so on. Please focus on whether the following configurations are complete:
1 Open "programs and features" To see if the IIS configuration is complete and find the following:
2 subsequently check the published Web site folder permissions, as follows:
Right-click the site folder-> Properties-> Security, add iis_iusrs,iusr, click Edit-> Add-> Advanced-> Find Now, find iis_iusrs,iusr, confirm Add, check "Full Control" respectively.
The above can basically solve most problems, if there is a better way, welcome correction.