简单FSO教程

 

FSO教程(一)
FSO,正如UFO般令人激动、令人神往,当然更多的亦是让人欢喜让人忧。君不见某空间服务商广告:100MB空间只要60RMB/年,支持数据库,支持什么什么……一问不支持FSO,立马泄气。那FSO究竟是什么东西,它的力量又是如何巨大,其操作的原理又是怎的怎的呢?这次来个彻底的理解。 


  首先,FSO是FileSystemObject的简称。当然也就是我们的俗称FSO组件了,该组件可以用来处理驱动器、文件夹以及文件。 


  它可以检测并显示出系统驱动器的信息分配情况;还能够创建、改变、移动和删除文件夹,并能探测一些给定的文件夹是否存在,若存在,还能提取出该文件夹的信息,如名称、被创建或最后一次修改的日期,等等。FSO还使得对文件的处理变得很容易。 


  一、fso.GetDrive 


  正如其它组件的建立一样,FSO的引用也必须建立连接。 

 

Set fso=Server.CreateObject("Scripting.FileSystemObject")  注意CreateObject的内部再也不是MSWC了,而是Scripting。
  那下面就可以通过fso来处理驱动器了。比如fso.GetDriveName提取驱动器名,fso.GetDrive同样提取标准驱动器名。比如: 


  1,fso.asp 

 

&#13; </div>&#13; </div><div id="MySignature"></div> <div class="clear"></div> <div id="blog_post_info_block"> <div id="BlogPostCategory"></div> <div id="EntryTag"></div> <div id="blog_post_info"> </div> <div class="clear"></div> <div id="post_next_prev"></div> </div> </div> <div class = "postDesc">posted @ <span id="post-date">2008-03-31 10:54</span> <a href='http://www.cnblogs.com/yeye518/'>天涯海客</a> 阅读(<span id="post_view_count">...</span>) 评论(<span id="post_comment_count">...</span>) <a href ="http://i.cnblogs.com/EditPosts.aspx?postid=2231777" rel="nofollow">编辑</a> <a href="#" onclick="AddToWz(2231777);return false;">收藏</a></div> </div> <script type="text/javascript">var allowComments=true,isLogined=false,cb_blogId=96256,cb_entryId=2231777,cb_blogApp=currentBlogApp,cb_blogUserGuid='bc9d21f0-2307-e011-ac81-842b2b196315',cb_entryCreatedDate='2008/3/31 10:54:00';loadViewCount(cb_entryId);</script> </div><!--end: topics 文章、评论容器--> </div><a name="!comments"></a><div id="blog-comments-placeholder"></div><script type="text/javascript">var commentManager = new blogCommentManager();commentManager.renderComments(0);</script> <div id="comment_form" class="commentform"> <a name="commentform"></a> <div id="divCommentShow"></div> <div id="comment_nav"><span id="span_refresh_tips"></span><a href="javascript:void(0);" id="lnk_RefreshComments" onclick="return RefreshCommentList();">刷新评论</a><a href="#" onclick="return RefreshPage();">刷新页面</a><a href="#top">返回顶部</a></div> <div id="comment_form_container"></div> <div class="ad_text_commentbox" id="ad_text_under_commentbox"></div> <div id="site_nav_under"><a href="http://www.cnblogs.com/" target="_blank" title="开发者的网上家园">博客园首页</a><a href="http://q.cnblogs.com/" target="_blank" title="程序员问答社区">博问</a><a href="http://news.cnblogs.com/" target="_blank" title="IT新闻">新闻</a><a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a><a href="http://job.cnblogs.com/" target="_blank">程序员招聘</a><a href="http://kb.cnblogs.com/" target="_blank">知识库</a></div> <div id="opt_under_post"></div> <script type="text/javascript"> var enableGoogleAd = canShowAdsense(); fixPostBodyFormat(); </script> <script type='text/javascript'> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; (function () { if (enableGoogleAd) { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); } })(); </script> <script type='text/javascript'> try { if (enableGoogleAd) { googletag.cmd.push(function() { googletag.defineSlot('/1090369/cnblogs_blogpost_C2', [468, 60], 'div-gpt-ad-1433581717989-0').addService(googletag.pubads()); googletag.defineSlot('/1090369/cnblogs_blogpost_C1_sitehome', [300, 250], 'div-gpt-ad-1433581717989-1').addService(googletag.pubads()); googletag.pubads().enableSingleRequest(); googletag.pubads().collapseEmptyDivs(); googletag.enableServices(); }); }; } catch (e) { } </script> <div id="google_ad_c1" class="c_ad_block"> <div id='div-gpt-ad-1433581717989-1' style='height:250px; width:300px;'> <script type='text/javascript'> try { if (enableGoogleAd) { googletag.cmd.push(function () { googletag.display('div-gpt-ad-1433581717989-1'); }); } else { $('#div-gpt-ad-1433581717989-1').hide(); } } catch (e) { } </script> </div> </div> <div id="under_post_news"></div> <div id="google_ad_c2" class="c_ad_block"> <div id='div-gpt-ad-1433581717989-0' style='height:60px; width:468px;'> <script type='text/javascript'> try { if (enableGoogleAd) { googletag.cmd.push(function () { googletag.display('div-gpt-ad-1433581717989-0'); }); } else { $('#div-gpt-ad-1433581717989-0').hide(); } } catch (e) { } </script> </div> </div> <div id="under_post_kb"></div> <div id="HistoryToday" class="c_ad_block"></div> <script type="text/javascript"> $(function () { loadNewsAndKb(); loadBlogSignature(); LoadPostInfoBlock(cb_blogId, cb_entryId, cb_blogApp, cb_blogUserGuid); GetPrevNextPost(cb_entryId, cb_blogId, cb_entryCreatedDate); loadOptUnderPost(); GetHistoryToday(cb_blogId, cb_blogApp, cb_entryCreatedDate); setTimeout(function () { incrementViewCount(cb_entryId); }, 200); }); </script> </div> </div><!--end: forFlow --> </div><!--end: mainContent 主体内容容器--> <div id="sideBar"> <div id="sideBarMain"> <!--done--> <div class="newsItem"> <h3 class="catListTitle">公告</h3> <div id="blog-news"></div><script type="text/javascript">loadBlogNews();</script> </div> <div id="calendar"><div id="blog-calendar" style="display:none"></div><script type="text/javascript">loadBlogDefaultCalendar();</script></div> <DIV id="leftcontentcontainer"> <div id="blog-sidecolumn"></div><script type="text/javascript">loadBlogSideColumn();</script> </DIV> </div><!--end: sideBarMain --> </div><!--end: sideBar 侧边栏容器 --> <div class="clear"></div> </div><!--end: main --> <div class="clear"></div> <div id="footer"> <!--done--> Copyright &copy;2015 天涯海客 </div><!--end: footer --> </div><!--end: home 自定义的最大容器 --> </body> </html>

你可能感兴趣的:(教程)