久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      asp遍歷某路徑下文件夾并實(shí)現(xiàn)MP3數(shù)據(jù)保存到數(shù)據(jù)庫(kù)

      本文的示例是在asp中遍歷某路徑下文件夾,并把所有MP3數(shù)據(jù)讀到數(shù)據(jù)庫(kù)中,具體實(shí)現(xiàn)如下:

      <!–#include file=”Sql_Conn.asp”–><!–#include file=”Inc/Inc.asp”–><!–#include file=”Inc/Config.asp”–>
      <%
      function GetExtendName(FileName) 
      dim ExtName 
      ExtName = LCase(FileName) 
      ExtName = right(ExtName,3) 
      ExtName = right(ExtName,3-Instr(ExtName,”.”)) 
      GetExtendName = ExtName 
      end function

      ‘便歷某路徑下文件夾,把所有MP3數(shù)據(jù)讀到數(shù)據(jù)庫(kù) 
          function bianli(path)
              dim fso            ‘fso對(duì)象
              dim objFolder      ‘文件夾對(duì)象
              dim objSubFolders ‘子文件夾集合
              dim objSubFolder   ‘子文件夾對(duì)象
              dim objFiles       ‘文件集合
              dim objFile        ‘文件對(duì)象

              set fso=server.CreateObject(“scripting.filesystemobject”)    
              on error resume next
              set objFolder=fso.GetFolder(path)’創(chuàng)建文件夾對(duì)象
              set objSubFolders=objFolder.Subfolders’創(chuàng)建的子文件夾對(duì)象
              for each objSubFolder in objSubFolders
                  ‘nowpath=path + “\” + objSubFolder.name
                  nowpath=path  + objSubFolder.name
                 ‘ Response.Write nowpath
                  set objFiles=objSubFolder.Files
                  for each objFile in objFiles
                    if GetExtendName(objFile.name)  = “mp3” then
                                    Response.Write “<br>”
                      ‘Response.Write objFile.name
                      
                      dim lc_lj 
                      lc_lj = nowpath + “/” +objFile.name
                      lc_lj=Mid(lc_lj,4)         ‘ 由lc_lj的第4個(gè)字符讀起,讀取后面的所有字符。
                      lc_lj=Replace(lc_lj,””,”/”)
                      ‘response.Write(lc_lj)
                      
                      dim lc_now
                      lc_now = now()
                      response.write lc_now
                      
                      dim sql_in
                      ‘sql_in = “insert into ylmv_dj(djCat_Id,specialid,Dj_name,Hits,dj_url,path,dj_pic,dj_user,tjuser,dj_word,dj_desc,IsBest,istop,grade,DownHits,BoxHits,uHits,dHits,DayHits,WeekHits,MonthHits,error,passed,points,music,dj_date,lasthittime) values(11,0,'”+ objFile.name  +”‘,0,'”+ lc_lj +”‘,5,’rm’,’紫龍舞曲管理’,’admin’,'”+ objFile.name +”‘,’☆☆★★★’,1,1,1,0,0,0,0,0,0,0,0,0,0,0,'”+lc_now +”‘,'”+lc_now+”‘)”

                      sql_in1 = “insert into ylmv_dj(djCat_Id,specialid,Dj_name,Hits,dj_url,path,dj_pic,dj_user,tjuser,dj_word,dj_desc,IsBest,istop,grade,DownHits,BoxHits,uHits,dHits,DayHits,WeekHits,MonthHits,error,passed,points,music,deleted) values(11,0,'”+ objFile.name  +”‘,0,'”+ lc_lj +”‘,5,’rm’,’紫龍舞曲管理’,’admin’,'”+ objFile.name +”‘,’☆☆★★★’,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0)”

                      ‘Response.Write objFile.name
                      ‘response.Write sql_in1
                      conn.execute(sql_in1)
                       Response.Write “<br>”
                      response.Write(“添加”+objFile.name+”!!!!!!”)
                    end if
                  

                  next
                  Response.Write “<p>”
                  bianli(nowpath)    ‘調(diào)用遞歸
              next
              set objFolder=nothing
              set objSubFolders=nothing
              set fso=nothing
          end function
      %>
      <%
          bianli(“F:Music”) ‘調(diào)用bianli()函數(shù),這里是遍歷F:盤
      %>

       

      分享到: 更多

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)