|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了,在给客户做个程序时,俄然碰到个成绩,就是产物页用户提交视频播放文件时,怎样依据提交的网址内的视频格局举行准确的播放呢....忧郁了一会,想好了思绪,说下手就下手...
思绪是先获得文件的范例,并依据范例选择分歧的网页播放器代码..三下五往二.....同时为了代码在今后的复用性,写成了通用的挪用函数.便利今后在其余体系中挪用..
现公布源代码以下:
以下为援用的内容:
SubSelPlay(strUrl,strWidth,StrHeight)
DimExts,isExt
IfstrUrl""Then
isExt=LCase(Mid(strUrl,InStrRev(strUrl,".")+1))
Else
isExt=""
EndIf
Exts="avi,wmv,asf,mov,rm,ra,ram"
IfInstr(Exts,isExt)=0Then
Response.write"不法视频文件"
Else
SelectCaseisExt
Case"avi","wmv","asf","mov"
Response.write"<EMBEDid=MediaPlayersrc="&strUrl&"width="&strWidth&"height="&strHeight&"loop=""false""autostart=""true""></EMBED>"
Case"mov","rm","ra","ram"
Response.Write"<OBJECTheight="&strHeight&"width="&strWidth&"classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>"
Response.Write"<PARAMNAME=""_ExtentX""VALUE=""12700"">"
Response.Write"<PARAMNAME=""_ExtentY""VALUE=""9525"">"
Response.Write"<PARAMNAME=""AUTOSTART""VALUE=""-1"">"
Response.Write"<PARAMNAME=""SHUFFLE""VALUE=""0"">"
Response.Write"<PARAMNAME=""PREFETCH""VALUE=""0"">"
Response.Write"<PARAMNAME=""NOLABELS""VALUE=""0"">"
Response.Write"<PARAMNAME=""SRC""VALUE="""&strUrl&""">"
Response.Write"<PARAMNAME=""CONTROLS""VALUE=""ImageWindow"">"
Response.Write"<PARAMNAME=""CONSOLE""VALUE=""Clip"">"
Response.Write"<PARAMNAME=""LOOP""VALUE=""0"">"
Response.Write"<PARAMNAME=""NUMLOOP""VALUE=""0"">"
Response.Write"<PARAMNAME=""CENTER""VALUE=""0"">"
Response.Write"<PARAMNAME=""MAINTAINASPECT""VALUE=""0"">"
Response.Write"<PARAMNAME=""BACKGROUNDCOLOR""VALUE=""#000000"">"
Response.Write"</OBJECT>"
Response.Write"<BR>"
Response.Write"<OBJECTheight=32width="&strWidth&"classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>"
Response.Write"<PARAMNAME=""_ExtentX""VALUE=""12700"">"
Response.Write"<PARAMNAME=""_ExtentY""VALUE=""847"">"
Response.Write"<PARAMNAME=""AUTOSTART""VALUE=""0"">"
Response.Write"<PARAMNAME=""SHUFFLE""VALUE=""0"">"
Response.Write"<PARAMNAME=""PREFETCH""VALUE=""0"">"
Response.Write"<PARAMNAME=""NOLABELS""VALUE=""0"">"
Response.Write"<PARAMNAME=""CONTROLS""VALUE=""ControlPanel,StatusBar"">"
Response.Write"<PARAMNAME=""CONSOLE""VALUE=""Clip"">"
Response.Write"<PARAMNAME=""LOOP""VALUE=""0"">"
Response.Write"<PARAMNAME=""NUMLOOP""VALUE=""0"">"
Response.Write"<PARAMNAME=""CENTER""VALUE=""0"">"
Response.Write"<PARAMNAME=""MAINTAINASPECT""VALUE=""0"">"
Response.Write"<PARAMNAME=""BACKGROUNDCOLOR""VALUE=""#000000"">"
Response.Write"</OBJECT>"
EndSelect
EndIf
EndSub
挪用体例:
以下为援用的内容:
CallSelPlay(DvUrl,280,220)
本文搜集收拾自互联网,若您是原文作者,请来信变动作者及出处Post#chinaz.com(把#改成@)
源代码保护方面其实现在考虑得没那么多了..NET也可以反编译.ASP写得复杂的话别人能看得懂的话.他也有能力自己写了.这方面担心的倒不太多.纵观现在网上可以下载的那些所谓BBS还有什么网站等等的源代码 |
|