当前位置:编程学习 > C#/ASP.NET >>

使用<script src="xx.aspx"></script> 如何取得来路地址

我在做页面访问统计的时候用<script src="xx.aspx"></script> 进行统计,这样的结果就使 Request.UrlReferrer 成了引用它的页面地址 而不是我想要的 来路地址,请问谁有什么好的方法呢? 
--------------------编程问答-------------------- <img src="xx.aspx" /> --------------------编程问答--------------------   function GetLocalIPAddress()
{
    var obj = null;
    var rslt = "";
    try
    {
        obj = new ActiveXObject("rcbdyctl.Setting");
        rslt = obj.GetIPAddress;
        obj = null;
    }
    catch(e)
    {
        //异常发生
    }    
    return rslt;
}
document.write("你的IP是:" + GetLocalIPAddress());
希望我理解对了你的意思! --------------------编程问答-------------------- 不是 我是用 xx.htm 页面里 用 <script src="xx.aspx"></script> 对页面进行访问统计,是要在xx.aspx里 取得xx.htm的 访问来路地址,普通的用 Request.UrlReferrer  取得的地址就成了 调用它的xx.htm地址了,而不是真正的来路地址。我想取得真正的来路地址,那些做专业统计的好象都是这样引用的 也取得了来路,不知道是怎么做到的 --------------------编程问答-------------------- 没人回答哦 我这个是统计人气的 这几天没人刷疯了 什么办法都想了 但是还是控制不了 郁闷 --------------------编程问答--------------------
var account='xiaoxiao';
var cReferrer,cPage;
window.onerror=null;
var cHeight, cWidth, cBitDepth, cResolution;
cHeight = screen.height;
cWidth = screen.width;
cBitDepth = screen.colorDepth;
if (cBitDepth == null)
{
cBitDepth = screen.pixelDepth;
}
cResolution = cWidth + "x" + cHeight;
cReferrer = escape(document.referrer)+"";
cPage = escape(document.location.href)+""   ;//.replace(/^([^\:]+):\/\/([^\/]+)(.*)$/ig, "$3");
document.write ("<img src='xx.aspx?page=" + cPage + "&account="+ account +"&res=" + cResolution + "&col=" + cBitDepth + "&ref=" + cReferrer + "' border='0' height='0' width='0'>");
 
cReferrer = escape(document.referrer)+"";
这个就是吧... --------------------编程问答-------------------- 我是问到了xx.aspx页面里的 .net 处理有什么办法 怎么都跑去说脚本了呢 脚本取值用get传 很容易被假冒。 --------------------编程问答-------------------- 在page_load中写  if (!IsPostBack)
            {
                if (Request.UrlReferrer != null)
                {
                    ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                }
            }
然后底下写一个方法,判断一下
 if (ViewState["UrlReferrer"]!=null)
            {
                 Response.Redirect(ViewState["UrlReferrer"].ToString());
            }
再调用就行了 ,对么?? --------------------编程问答-------------------- 不用脚本不太可能实现
浏览器应该是不用主动提交这些东西的,这里涉及到安全、隐私等等一系列的问题
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,