首页 >> 下载中心 >> Asp源码 >> 仿Acdsee浏览图片Asp程序源码

仿Acdsee浏览图片Asp程序源码

作者:天空诚整理 来源:csdn 时间:2008-10-27 网友评论条 【

我的浏览器仿acdsee看图效果,asp程序源码,使用fso遍历列出文件夹所有图片。共两个源文件文件。

实现了幻灯片播放效果,还可以在下拉框中选择要看的图片。selsect下拉列表中自动列出了文件夹下图片的文件名。 

中国asp之家测试了,并修改了程序中错误的地方,现在可以正常运行了,不错的fso浏览文件夹文件的系统,美工方面大家可以自己再修改。

acdsee.htm  

效果演示:

MM很漂亮吧!
    

打包下载地址:asp-acdsee-fso.rar (1.82 KB)

asp源代码如下:

<html>   
  <head>   
  <META   name=VI60_defaultClientScript   content=VBScript>   
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">   
  <title>浏览器防acdsee看图程序</title>   
  <SCRIPT   ID=clientEventHandlersVBS   LANGUAGE=vbscript>   
  <!--   
    
  Sub   Submit_onclick   
  window.open   "acdsee.asp",null,"fullscreen=yes"   
  window.opener=null   
  window.close   
  End   Sub   
    
  -->   
  </SCRIPT>   
  </head>   
    
  <body>   
  浏览器防acdsee看图程序,载入根据图片多少,每500张,需要1分钟或者更长时间,请稍等.....<br>   
  <input   type="button"   name="Submit"   value="是,我想看">   
    
    
  </body>   
  </html>   

    
    acdsee.asp文件       
 

 <body   bgcolor="#000000"   leftmargin="0"   topmargin="0"   marginwidth="0"   marginheight="0">   
  <table   width="100%"   border="0"   cellspacing="0"   cellpadding="0">   
      <tr>   
      
          <td     align="left"   valign="top"   nowrap   id=mytd>     
              <select   id=select1   name=select1>   
    <%   
    
    
  Dim   FSO,picname,mycount   
  mycount=0   
  Set   FSO   =  CreateObject("Scripting.FileSystemObject")   
  '这句换成自己的文件夹路径   
  DoDir   FSO.GetFolder("c:")   
    
    
  Sub   DoDir(Folder)   
        On   Error   Resume   Next   
        Dim   File,SubFolder   
        For   Each   File   In   Folder.Files   
              'WScript.StdOut.WriteLine   File.Path   
                
              if   lcase(right(File.Path,4))=".jpg"   or     lcase(right(File.Path,4))="jpeg"     then   
              mycount=mycount+1   
              %>   
  <option   value="<%=File.Path%>"><%=trim(File.Name)%></option>   
  <%   
  picname=File.Path   
  end   if   
        Next   
        For   Each   SubFolder   in   Folder.SubFolders   
              DoDir   SubFolder   
        Next   
  End   Sub   
  %></select>   
              <br>   
              <input   type="button"   name="Submit1"   value="上一个"   onclick="vbs:prevpic">   
              <br>   
              <input   type="button"   name="Submit2"   value="下一个"   onclick="vbs:nextpic">   
              <br>   
              <input   type="button"   name="Submit3"   value="随机播放幻灯片"   onclick="vbs:showme">   
              <br>   
              <input   type="button"   name="Submit32"   value="关闭窗口"   onClick="vbs:shutdown">   
              <br>   
              <font   color="#FFFFFF">共<%=mycount%>张</font><br>   
          </td>   
                      
          <td   width="100%"   align="center"   valign="top"   ><img   src="<%=picname%>"   id="mypic"   onmouseout="vbs:mytd.style.display='block'"   onmouseover="vbs:mytd.style.display='none'"></td>   
      </tr>   
  </table>   
  <SCRIPT   ID=clientEventHandlersVBS   LANGUAGE=vbscript>   
  <!--   
    
  dim   flag   
  flag=0   
    
    
    
  Sub   select1_onchange   
  showpic   
  End   Sub   
  sub   prevpic()   
  if   select1.selectedIndex=0   then   
  select1.selectedIndex=select1.options.length-1   
  showpic   
  else   
  select1.selectedIndex=select1.selectedIndex-1   
  showpic   
  end   if   
  end   sub   
    
  sub   nextpic()   
  if   select1.selectedIndex=select1.options.length-1   then   
  select1.selectedIndex=0   
  showpic   
  else   
  select1.selectedIndex=select1.selectedIndex+1   
  showpic   
  end   if   
  end   sub   
    
  sub   slidshow()   
    
  if   Submit3.value="     停     止     "   then   
  window.setTimeout   "rndpic","3000"   
  window.setTimeout   "slidshow","3000"   
  end   if   
  end   sub   
  sub   showpic()   
  dim   beisx,beisy,beis   
  mypic.src=trim(select1.value)   
  end   sub   
    
  sub   rndpic()   
  dim   Mypicid   
  randomize   
  Mypicid=int(rnd   *   select1.options.length)   
  select1.selectedIndex=Mypicid   
  showpic   
  end   sub   
  sub   showme()   
  flag=flag+1   
  if   flag   mod   2   =0   then   
  Submit3.value="随机播放幻灯片"   
    
  else   
  Submit3.value="     停     止     "   
  slidshow   
  end   if   
  end   sub   
  sub   shutdown()   
  window.opener=null   
  window.close   
  end   sub   
  -->   
  </SCRIPT>   

站长工具
搜索引擎收录情况:
相关文章
loading 请稍等,评论加载中...

学习Asp到中国Asp之家(Aspxhome.com)

闽ICP备06017341号