效果图:
下载地址:http://download.csdn.net/detail/tiz198183/4778086
一、网页
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=scriptmain name=scriptmain codebase="http://download.macromedia.com/pub/shockwave/cabs/ flash/swflash.cab#version=6,29,0" width="300" height="261"> <param name="movie" value="FlashXml/Flash/bcastr.swf?bcastr_xml_url=FlashXml/bcastrXML.ashx"> <param name="quality" value="high"> <param name=scale value=noscale> <param name="LOOP" value="false"> <param name="menu" value="false"> <param name="wmode" value="transparent"> <embed src="FlashXml/Flash/bcastr.swf?bcastr_xml_url=FlashXml/bcastrXML.ashx" width="300" height="261" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" salign="T" name="scriptmain" menu="false" wmode="transparent"></embed> </object>
二、处理页面
<%@ WebHandler Language="C#" Class="bcastrXML" %> using System; using System.Web; using System.Data; using BLL; public class bcastrXML : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; DataTable dt = News.GetList(" and path<>''").Tables[0]; context.Response.Write("<?xml version='1.0' encoding='utf-8' ?><bcaster autoplayTime='3'>"); for (int i = 0; i < 9; i++) { context.Response.Write("<item item_url='" + dt.Rows[i]["path"] + "' link='http://' itemtitle=''></item>"); } context.Response.Write("</bcaster>"); } public bool IsReusable { get { return false; } } }
实例2:
代码地址:http://download.csdn.net/detail/tiz198183/4763549