推薦:趣味訪客計(jì)數(shù)器設(shè)計(jì)兩則訪客計(jì)數(shù)器作為網(wǎng)站不可缺少的部分,不僅可以記錄網(wǎng)站被訪問(wèn)的次數(shù),而且可以通過(guò)生動(dòng)有趣的設(shè)計(jì)來(lái)加強(qiáng)網(wǎng)頁(yè)的趣味性和可觀賞性,使訪客計(jì)數(shù)器成為網(wǎng)頁(yè)上的一個(gè)風(fēng)景。下面介紹兩種輕松設(shè)計(jì)趣
在給客戶(hù)做個(gè)程序時(shí),突然遇到個(gè)問(wèn)題,就是產(chǎn)品頁(yè)用戶(hù)提交視頻播放文件時(shí),如何根據(jù)提交的網(wǎng)址內(nèi)的視頻格式進(jìn)行正確的播放呢....郁悶了一會(huì),想好了思路,說(shuō)動(dòng)手就動(dòng)手...
思路是先取得文件的類(lèi)型,并根據(jù)類(lèi)型選擇不同的網(wǎng)頁(yè)播放器代碼..三下五去二.....同時(shí)為了代碼在以后的復(fù)用性,寫(xiě)成了通用的調(diào)用函數(shù).方便以后在別的系統(tǒng)中調(diào)用..
現(xiàn)發(fā)布源代碼如下:
以下為引用的內(nèi)容: Sub SelPlay(strUrl,strWidth,StrHeight) Dim Exts,isExt If strUrl <> "" Then isExt = LCase(Mid(strUrl,InStrRev(strUrl, ".") 1)) Else isExt = "" End If Exts = "avi,wmv,asf,mov,rm,ra,ram" If Instr(Exts,isExt)=0 Then Response.write "非法視頻文件" Else Select Case isExt Case "avi","wmv","asf","mov" Response.write "<EMBED id=MediaPlayer src="&strUrl&" width="&strWidth&" height="&strHeight&" loop=""false"" autostart=""true""></EMBED>" Case "mov","rm","ra","ram" Response.Write "<OBJECT height="&strHeight&" width="&strWidth&" classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>" Response.Write "<PARAM NAME=""_ExtentX"" VALUE=""12700"">" Response.Write "<PARAM NAME=""_ExtentY"" VALUE=""9525"">" Response.Write "<PARAM NAME=""AUTOSTART"" VALUE=""-1"">" Response.Write "<PARAM NAME=""SHUFFLE"" VALUE=""0"">" Response.Write "<PARAM NAME=""PREFETCH"" VALUE=""0"">" Response.Write "<PARAM NAME=""NOLABELS"" VALUE=""0"">" Response.Write "<PARAM NAME=""SRC"" VALUE="""&strUrl&""">" Response.Write "<PARAM NAME=""CONTROLS"" VALUE=""ImageWindow"">" Response.Write "<PARAM NAME=""CONSOLE"" VALUE=""Clip"">" Response.Write "<PARAM NAME=""LOOP"" VALUE=""0"">" Response.Write "<PARAM NAME=""NUMLOOP"" VALUE=""0"">" Response.Write "<PARAM NAME=""CENTER"" VALUE=""0"">" Response.Write "<PARAM NAME=""MAINTAINASPECT"" VALUE=""0"">" Response.Write "<PARAM NAME=""BACKGROUNDCOLOR"" VALUE=""#000000"">" Response.Write "</OBJECT>" Response.Write "<BR>" Response.Write "<OBJECT height=32 width="&strWidth&" classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>" Response.Write "<PARAM NAME=""_ExtentX"" VALUE=""12700"">" Response.Write "<PARAM NAME=""_ExtentY"" VALUE=""847"">" Response.Write "<PARAM NAME=""AUTOSTART"" VALUE=""0"">" Response.Write "<PARAM NAME=""SHUFFLE"" VALUE=""0"">" Response.Write "<PARAM NAME=""PREFETCH"" VALUE=""0"">" Response.Write "<PARAM NAME=""NOLABELS"" VALUE=""0"">" Response.Write "<PARAM NAME=""CONTROLS"" VALUE=""ControlPanel,StatusBar"">" Response.Write "<PARAM NAME=""CONSOLE"" VALUE=""Clip"">" Response.Write "<PARAM NAME=""LOOP"" VALUE=""0"">" Response.Write "<PARAM NAME=""NUMLOOP"" VALUE=""0"">" Response.Write "<PARAM NAME=""CENTER"" VALUE=""0"">" Response.Write "<PARAM NAME=""MAINTAINASPECT"" VALUE=""0"">" Response.Write "<PARAM NAME=""BACKGROUNDCOLOR"" VALUE=""#000000"">" Response.Write "</OBJECT>" End Select End If End Sub |
調(diào)用方式:
以下為引用的內(nèi)容: Call SelPlay(DvUrl,280,220) |
分享:推薦:ASP初學(xué)者常用源代碼總結(jié)篇1.獲得系統(tǒng)時(shí)間: <%=now()%> 2.取得來(lái)訪用的IP: <%=request.serverVariables("remote_host")%> 3.獲得系統(tǒng),瀏覽器版本: <script>
|
新聞熱點(diǎn)
疑難解答
圖片精選