国外产品展示网站源码,房建设计图网站,iis7重启 网站,网页宣传首先#xff0c;要想手机端应用能成功请求后端#xff0c;两个设备至少需在同一个局域网内#xff0c;且IP地址互通#xff1b;
因为ajax是http(s)://IP地址端口号的方式请求#xff0c;但是iisExpress默认是localhost如何解决#xff0c;并没有IP地址#xff0c;所以手…首先要想手机端应用能成功请求后端两个设备至少需在同一个局域网内且IP地址互通
因为ajax是http(s)://IP地址端口号的方式请求但是iisExpress默认是localhost如何解决并没有IP地址所以手机无法通过IP访问后端如何设置看如下一图即可 打开vs.net项目如图路径找到applicationhost.config文件添加你自己的电脑IP到如下节点 site namemawbocr(1) id8application path/ applicationPoolClr4IntegratedAppPoolvirtualDirectory path/ physicalPathD:\mayun\mawbocr\mawbocr //applicationbindingsbinding protocolhttps bindingInformation*:44360:localhost /binding protocolhttp bindingInformation*:3617:localhost /binding protocolhttps bindingInformation*:44360:192.168.4.103 /binding protocolhttp bindingInformation*:3617:192.168.4.103 //bindings
/site
需要注意如果你曾经运行过项目会发现有很多site/site节点找到与iisExpress当前运行的同名节点我这里是这个名字 mawbocr(1) 最后保存运行项目就可以看到你添加的IP了。
如果还是不通可能是电脑自带防火墙问题去添加端口允许。