加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

FLASH连接数据库

发布时间:2020-12-15 18:10:39 所属栏目:百科 来源:网络整理
导读:system.usecodepage = true; _global.arrtitle = new array(5); _global.arrimage = new array(5); _global.arrurl = new array(5); function loadxml() { myxml = new xml(); myxml.ignorewhite = true; myxml.load("http://192.168.0.244/8mchina2/flash/t

system.usecodepage = true;

_global.arrtitle = new array(5);
_global.arrimage = new array(5);
_global.arrurl = new array(5);

function loadxml()
{
myxml = new xml();
myxml.ignorewhite = true;
myxml.load("http://192.168.0.244/8mchina2/flash/tvindex.aspx");
myxml.onload = function(success)
{
if (success)
{
len = myxml.firstchild.childnodes.length;
for(i=0; i<5; i++)
{
_global.arrtitle[i] = myxml.firstchild.childnodes[i].attributes.title;
_global.arrimage[i] = myxml.firstchild.childnodes[i].attributes.image;
_global.arrurl[i] = myxml.firstchild.childnodes[i].attributes.url;
eval("_root.txt" + (i+1)).text = _global.arrtitle[i];
}
}
else
{
loadxml();
}
};
}
loadxml();

aspx文件处理: <%@ import namespace="bmhd.components.components" %> <%@ import namespace="bmhd.components" %> <%@ page language="c#" codebehind="tvindex.aspx.cs" autoeventwireup="false" inherits="bmhd.web.xml.tvindex" %><?xml version="1.0" encoding="gb2312" ?> <xml> <asp:repeater id="repeater1" runat="server"> <itemtemplate> <item id="<%# databinder.eval(container.dataitem,"id")%>" title="<%# databinder.eval(container.dataitem,"title")%>" url="<%# databinder.eval(container.dataitem,"link")%>" image="<%# topicpicture.getpictureurl(databinder.eval(container.dataitem,"imageurl").tostring())%>" /> </itemtemplate> </asp:repeater> </xml> 后台代码: private void page_load(object sender,system.eventargs e) { // 在此处放置用户代码以初始化页面 // response.contenttype = "text/xml"; repeater1.datasource = topics.gettop5tvindex().topics; repeater1.databind(); }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读