您当前的位置: 首页 > 

取得当前的文件之前的URL地址.

发布时间:2008-12-02 17:34:00 ,浏览量:0

建议写在Global.asax 的函数Session_Start内

void Session_Start(object sender, EventArgs e)     {         // 在新会话启动时运行的代码         string Path = string.Empty;         string pre = Request.ServerVariables["http_host"].ToString().Trim();         string pos = Request.ServerVariables["path_info"].ToString().Trim();         int i;         i = pre.IndexOf("localhost:");         if (i < 0) { Path = pre + "/"; }         else { Path = pre + pos.Substring(0, pos.LastIndexOf("/") + 1); }         Session["Path"] = "http://" + Path;             }

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    107388博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0446s