首页 新闻 会员 周边

webservice高手进

0
悬赏园豆:5 [已解决问题] 解决于 2013-06-03 00:23
<form method="post" name="bj_name" action="http://localhost:3930/WebService2.asmx/Do" >
<input type="hidden" id="bgUrl" runat="server" />
<input type="submit" id="submit" value="提交" />
</form>
IIS把实际地址该为 http://外网IP:3930/WebService2.asmx/Do

为什么本地的时候可以调用到。部署到IIS的时候不能访问了。。提示无法访问 WebService2.asmx/Do

问题2

 public partial class WebForm2 : System.Web.UI.Page
    {
        public static string str = System.Configuration.ConfigurationManager.AppSettings["fuck"];
        protected void Page_Load(object sender, EventArgs e)
        {
                Response.Write(str);
        }
    }

webconfig:
<appSettings>
    <add key="fuck" value="1"/>
  </appSettings>
浏览后显示1,马上修改配置文件为2 。保存刷新。为什么值变成2了??str 不是静态变量嘛??怎么会更新为2的??
KeVinDurant的主页 KeVinDurant | 初学一级 | 园豆:5
提问于:2013-05-06 21:51
< >
分享
最佳答案
0

首先怨气很重啊,fuck都用上了。

1,

http://外网IP:3930/WebService2.asmx/Do

端口3930没开,总之就是网络的原因,至于iis开端口,另外google之

2,web.config变动,appdomain重新加载,也就是相当于网站重启了,所以WebForm2又初始化了。

收获园豆:5
arg | 小虾三级 |园豆:1047 | 2013-05-07 01:27

分析的不错 :-)

wenthink | 园豆:417 (菜鸟二级) | 2013-05-07 08:13

部署到IIS。直接文本文件打开webconfig进行修改。。然后保存??appdomain会重新加载??,也就是相当于网站重启了???什么意思。说清楚点好吗??

KeVinDurant | 园豆:5 (初学一级) | 2013-05-07 22:22

@KeVinDurant: 只能帮您到这了,建议精读《asp.net 本质》

arg | 园豆:1047 (小虾三级) | 2013-05-07 23:51
其他回答(2)
0
  public static string str = System.Configuration.ConfigurationManager.AppSettings["fuck"];

你这一句是指向的配置文件,当程序访问str时,相当于访问配置文件,也就是=后面的。

Eric.luo | 园豆:853 (小虾三级) | 2013-05-16 14:53
0

1.防火墙的事。

2.静态变量不等于缓存~

太阳底下淋雨 | 园豆:207 (菜鸟二级) | 2013-05-17 18:41
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册