问题描述
<ASXVERSION="3.0"><ENTRY><TITLE>岁月无声</TITLE><REFHREF="MusicBeyond--岁月无声.mp3"/></ENTRY><ENTRY><TITLE>沧海一声笑</TITLE><REFHREF="Music沧海一声笑.mp3"/></ENTRY></ASX>初学者,希望高手说的详细点哈~
解决方案
解决方案二:
FileStreamfileStr=newFileStream(Server.MapPath("Bg_Music.asx"),FileMode.Create,FileAccess.Write);StreamWritersw=newStreamWriter(fileStr);sw.WriteLine("<ASXversion="3.0">");foreach(DataRowrindt_BackMuisc.Rows)//查询数据库得到的Table:dt_BackMuisc{if(r["UploadPath"]!=null){sw.WriteLine("<Entry>");sw.WriteLine("<Refhref=""+r["AdvName"].ToString()+"""+"></Ref>");//歌曲名称AdvNamesw.WriteLine("</Entry>");}}sw.WriteLine("</asx>");sw.Dispose();fileStr.Dispose();
时间: 2024-10-12 08:48:29