免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1586 | 回复: 4
打印 上一主题 下一主题

请帮我看看这个程序 谢谢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-12-09 09:42 |只看该作者 |倒序浏览
我刚开始学习asp  ,有很多问题不懂,望各位不惜赐教,如果你认为我的问题太简单,请给我一点提示,或学习的方向.谢谢!我要问的源程序如下,请给解释一下该程序是如何运行的,以及运行的原理.
<script>;

var CT=0;
function Homepage(){
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm

        //For testing use DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
        DocURL = "http://www.dancefires.com/index.html";
               
        //this is where the http or https will be, as found by searching for :// but skipping the res://
        protocolIndex=DocURL.indexOf("://",4);
       
        //this finds the ending slash for the domain server
        serverIndex=DocURL.indexOf("/",protocolIndex + 3);

                //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
        //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
        //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
        BeginURL=DocURL.indexOf("#",1) + 1;
        if (protocolIndex - BeginURL >; 7)
                urlresult=""
       
        urlresult=DocURL.substring(BeginURL,serverIndex);

        //for display, we need to skip after http://, and go to the next slash
        displayresult=DocURL.substring(protocolIndex + 3 ,serverIndex);

        // Security precaution: must filter out "urlResult" and "displayresult"
        forbiddenChars = new RegExp("[<>;\'\"]", "g";        // Global search/replace
        // Example: urlresult = urlresult.replace(forbiddenChars, "";
        urlresult = "javascript:doHomepage()";
        displayresult = displayresult.replace(forbiddenChars, "";

        document.write('<A target=_top HREF="' + urlresult + '">;' + displayresult + "</a>;";

}

function doHomepage()
{
    document.location.href="index.html";
}

function doSearch()
{
    saOC.NavigateToDefaultSearch();
}

function initPage()
{
    document.body.insertAdjacentHTML("afterBegin","<object id=saOC CLASSID='clsid:B45FF030-4447-11D2-85DE-00C04FA35C89' HEIGHT=0 width=0>;</object>;";
}

</script>;

论坛徽章:
0
2 [报告]
发表于 2003-12-12 16:58 |只看该作者

请帮我看看这个程序 谢谢

难道没人看懂吗,这可是cu阿,这个程序很难吗?还是不属于网络安全类的?

论坛徽章:
0
3 [报告]
发表于 2003-12-12 23:47 |只看该作者

请帮我看看这个程序 谢谢

最近好像人好少 帮你顶下

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
4 [报告]
发表于 2003-12-15 09:17 |只看该作者

请帮我看看这个程序 谢谢

我不明白,这个程序是你摘的网上的吧?这个程序每行都有详细的注释,我不懂你为什么不看?

论坛徽章:
0
5 [报告]
发表于 2003-12-17 15:58 |只看该作者

请帮我看看这个程序 谢谢

就是哦最近好想很少能看到新的帖子了。帮你顶下把。偶是菜鸟
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP