Scripting.FileSystemObject对象详细介绍

1 FileSystemObject对象成员概要 FileSystemObject对象提供一个属性和一系列方法,可用它们来操纵FileSystemObject对象实现的一些从属对象。这里提供了全部的内容概要,然后介绍每一个从属对象。1. FileSystemObject的属性FileSystemObject对象只有一个属性,它用于得到当前机器上的所有有效驱动器的列表,如表5-4所示:表5-4 FileSystemObject对象的属性及说明属 性说 明Drivers返回本地计算机可用的驱动器列表。2. FileSystemObject的方法FileSystemObject
http://www.w3dev.cn/article/20110812/asp-Scripting-FileSystemObject-introduce.aspx

Scripting.FileSystemObject对象

ystemObject对象提供一个属性和一系列方法,可用它们来操纵FileSystemObject对象实现的一些从属对象。这里提供了全部的内容概要,然后介绍每一个从属对象。1. FileSystemObject的属性FileSystemObject对象只有一个属性,它用于得到当前机器上的所有有效驱动器的列表,如表5-4所示:表5-4 FileSystemObject对象的属性及说明属 性 说 明 Drivers 返回本地计算机可用的驱动器列表。 2. FileSystemObject的方法FileSystemObject对象提供了使用从属对象的一系列方法,从属对象包括Drive、Fol
http://www.w3dev.cn/article/20090624/148.aspx

Scripting.FileSystemObject介绍

器不能创建对象e:\test为虚拟目录,什么用javascript无法新建一个.html文件呢!!高手指教!在线等待! ====================================+展开-HTMLscriptfunctionWriteFile(file,str){varfso,tf;fso=newActiveXObject("Scripting.FileSystemObject");tf=fso.CreateTextFile(file,true);tf.Write(str);tf.Close();}WriteFile("C:\\\\aaaa.txt","12345")/script
http://www.w3dev.cn/article/20090608/90.aspx

ASP实例教程:FileSystemObject对象

t("Scripting.FileSystemObject")p=fs.GetDriveName("c:\windows\cursors\abc.cur")Response.Write("驱动器名称是:" p)set fs=nothing%/body/html本实例运行结果如下:驱动器名称是:c: 取得某个指定路径的父文件夹的名称 本例演示如何使用GetParentFolderName方法来取得某个指定的路径的父文件夹的名称。 本示例代码如下:以下为引用的内容:htmlbody%Set fs=Server.CreateObject("Scripting.FileSystemObject")p
http://www.w3dev.cn/article/20090718/508.aspx

js将图片转换为base64

eXObject(msxml2.FreeThreadedDOMDocument) objXMLDoc.loadXML(?xml version='1.0'?Base64Data /) fs = new ActiveXObject(Scripting.FileSystemObject) if (fs.FileExists(FilePath)) { objStream = new ActiveXObject(ADODB.Stream) objStream.Type = 1 o
http://www.w3dev.cn/article/20151230/js-image-data-to-base64.aspx

asp files集合如何通过索引访问对象

的files集合不是数组,所以无法通过索引访问files集合中的项目,也没有提供相关方法进行访问。  解决办法:遍历files对象后将文件名存入数组中。  asp files集合如何通过索引访问对象源代码如下% set fso=server.CreateObject(scripting.filesystemobject) folder=Server.MapPath(.) set fd=fso.GetFolder(folder) set fs=fd.files l=fs.count-1 dim files() redim files(l) i=0
http://www.w3dev.cn/article/20151223/asp-files-collection-access-by-index.aspx

vbscript将图片转换为base64字符串

er.CreateObject(msxml2.FreeThreadedDOMDocument) objXMLDoc.loadXML ?xml version='1.0'?Base64Data / Set fs = Server.createObject(Scripting.FileSystemObject) ''FSO组件 If fs.FileExists(FilePath) Then '判断File文件是否存在 '用 stream 来读取数据 Set objStream = Server.CreateObject(ADODB.
http://www.w3dev.cn/article/20151203/asp-image-data-to-base64.aspx

asp采集解压gzip压缩网站数据

function unZip(file){ //在线解压zip函数 //by fisker (http://ifisker.com lionkay@gmail.com) var objFso=Server.CreateObject(scripting.FileSystemObject); var objWshShell=Server.CreateObject(Wscript.Shell); var zipFile=Server.MapPath(file); if(!objFso.FileExists(zipFi
http://www.w3dev.cn/article/20151119/asp-unzip-gzip-website-information.aspx

asp生成utf-8编码静态文件

  asp生成utf-8编码的静态html文件。Scripting.filesystemobject的createTextFile只能指定为unicode,所以asp要生成utf-8编码的静态文件,需要使用adodb.stream来生成,adodb.stream可以指定任何编码。'asp生成指定编码静态html页面过程源代码Sub WriteToTextFile(FileUrl,byval Str,CharSet) set stm=Server.CreateObject(adodb.stream) stm.Type=2'以本模式读取 stm.mode=3 stm.charset
http://www.w3dev.cn/article/20150907/asp-create-utf-8-html-file.aspx

asp批量读写更新文件utf-8编码文件示例

tf-8文件,asp写utf-8文件示例代码,asp adodb.stream读写utf-8文件示例。asp批量处理目录文件示例代码小提示:如果更新的是ansi编码的文件,只需要scripting.filesystemobject对象的opentextfile打开textstream数据流进行读写即可。如果是utf-8,只能使用adodb.stream进行操作,因为scripting.filesystemobject的charset只能指定为ascii,unicode和系统缺省编码(除非你系统缺省编码是utf-8,否则中文大陆内的大部分存储编码都是ansi)。  asp批量处理目录下文件,更
http://www.w3dev.cn/article/20141106/asp-bulk-read-write-update-file-demo.aspx

asp读取局域网共享文件

  asp如何读取局域网共享的文件内容,其实很简单,和读取本机上的文件一样,通过scripting.filesystemobject来读取,只是路径不能用server.mappath进行转换,而是使用通常访问别人共享的路径,如\\共享计算机名或者ip地址\目录\文件  asp读取局域网共享文件源代码如下%set fso=server.CreateObject(scripting.filesystemobject)set ts=fso.OpenTextFile(\\cbn137\Eshot\info.txt)response.Write ts.ReadAllts.closeset ts=not
http://www.w3dev.cn/article/20141105/asp-read-local-network-share-file.aspx

asp json类库解析json字符串

UAGE=VBSCRIPT CODEPAGE=936%!--#include file=aspJSON1.17.asp--%function readcontent(path) dim fso,txtstream set fso=server.CreateObject(scripting.filesystemobject) set txtstream=fso.OpenTextFile(path) readcontent=txtstream.readall txtstream.close set txtstream=nothing set fso=nothingend functi
http://www.w3dev.cn/article/20140916/asp-json-class.aspx

easyui datagrid数据导出excel文件示例

sition, attachment;filename=xxxx.xlsResponse.Write(data)''''''''生成临时文件代码'set fso=server.CreateObject(scripting.filesystemobject)'set ts=fso.CreateTextFile(server.MapPath(fn),true,true)'如果xml申明为gb2312,第三个参数改为false'ts.Write(data)'ts.close'set ts=
http://www.w3dev.cn/article/20140403/easyui-datagrid-import-to-excel.aspx

vbs文件获取当前的路径

currentpath = createobject(Scripting.FileSystemObject).GetFolder(.).Path或者currentpath = createobject(Scripting.FileSystemObject).GetFile(Wscript.ScriptFullName).ParentFolder.Path
http://www.w3dev.cn/article/20131122/vbs-file-get-current-path.aspx

vbscript获取文件修改,创建,访问时间

set fso=createobject(Scripting.FileSystemObject) set fn=fso.GetFile(E:\AD.txt) msgbox 文件创建时间:fn.DateCreated msgbox 文件最后修改时间:fn.DateLastModified msgbox 文件最后访问时间:fn.DateLastAccessed set fn=nothing set fso=nothing
http://www.w3dev.cn/article/20131122/vbs-get-file-create-modify-access-time.aspx

asp Scripting.Dictionary字典示例

  vbscript的Scripting.Dictionary创建了类似于Key索引对应Value值的字典对象,通过Key直接索引到指定的Value。  VBScript中Scripting.Dictionary使用示例如下Dim objDictSet objDict = WSH.CreateObject(Scripting.Dictionary) ' .Add(key, value) objDict.Add a, value1 objDict.Add b, value2 objDict.Add c, value3 '直接通过key=b索引到value2 W
http://www.w3dev.cn/article/20131119/asp-Scripting.Dictionary-demo.aspx

kindeditor上传插件分类保存路径细分修改

ath = savePath fd / saveUrl = saveUrl fd /end ifFunction CreateFolder(ByVal folderPath )'循环创建目录函数Dim oFSOSet oFSO = createObject(Scripting.FileSystemObject)Dim sParent sParent = oFSO.GetParentFolderName(folderPath)If sParent = Then Exit FunctionIf Not oFSO.FolderExists(sParent) Then CreateF
http://www.w3dev.cn/article/20131107/kindeditor-attach-save-path-modify.aspx

asp读写文件示例

  asp读出文件放入表单的textarea容器中,修改后写回原文件中。注意如果文件编码不是系统默认的ansi,调用opentextfile方法时加上编码。参考Scripting.FileSystemObject的OpenTextFile方法参数说明asp检测文件编码asp读写文件示例源代码%set fso=server.CreateObject(scripting.filesystemobject) if request.querystring(action)=update then content=request.Form(content) set ts=fso.OpenTex
http://www.w3dev.cn/article/20131029/asp-read-write-file-demo.aspx

asp解码chrw/chr编码文件还原为源代码

rw=s end functionfunction decodechrwfile(fn)'解码内容包含chrw编码的文件 s=readfile(fn) s=decodechrw(s) '将解码内容写回文件 set fso=createobject(scripting.filesystemobject) set ts=fso.OpenTextFile(replace(fn,.,_decode.),2,true,-2)'写入解码后的内容到原来文件名替换为 _decode的文件里面,如fn为encode.txt,则解码后的文件为encode_decode.txt
http://www.w3dev.cn/article/20130910/asp-chrw-chr-encode-content-decode.aspx

ASP内置对象类型属性介绍

t)Recordsetitem:False | items:False | contents:False | count:FalseServer.CreateObject(Scripting.FileSystemObject)FileSystemObjectitem:False | items:False | contents:False | count:FalseServer.CreateObject(Scripting.Dictionary)Dictionaryitem:True | items:True | contents:False | count:True备注:1.对于Reque
http://www.w3dev.cn/article/20130327/asp-object-type-attribute-introduction.aspx

asp无组件生成缩略图[非生成文件]

ilename=left(curFile,instrrev(curFile,\))cufilename'/////建立GPS类实体/////Dim GetPicSizeSet GetPicSize=new GPSSet fs=Server.CreateObject(Scripting.FileSystemObject)'/////获取图片类型/////Dim PicSuffixNamePicSuffixName=fs.GetExtensionName(filename)Dim PD '//Picture DimensionDim PWidth,PHeightSelect
http://www.w3dev.cn/article/20130317/asp-No-components-create-Thumbnail.aspx

asp往文件中追加重写内容源代码

ng:编码,0:ascii -1:unicode -2:系统缺省,中文系统为ANSIfunction WriteFile(filename,ct,readwriteMode,create,encoding) set fso=server.CreateObject(scripting.filesystemobject) if not fso.FileExists(server.MapPath(filename))then create=true'文件不存在则设置create为true set stream=fso.OpenTextFile(server.MapPath(fi
http://www.w3dev.cn/article/20120929/asp-append-rewrite-content-to-file.aspx

ASP执行ping命令获取结果

d:/web/%2.txt  (%1)是将来要ping的地址,(%2)是存储ping结果的文件.  以下是ASP执行ping命令获取结果源代码%IP = xxx.xxx.xxx.xxx 你要ping的地址Set FileSys = Server.CreateObject(Scripting.FileSystemObject)FileName = FileSys.GetTempNameSet WShShell = Server.CreateObject(WScript.Shell)RetCode = WShShell.Run(d:/web/aspping.BAT IP FileNa
http://www.w3dev.cn/article/20120915/asp-execute-ping-get-return-result.aspx

hta运行脚本经典代码

meant to be.'****************************************************************************Sub OpenScript Set objFSO = CreateObject(Scripting.FileSystemObject) strOpenFileName = InputBox(Please enter the complete pathname for your script (for example, C:\Scripts\MyScript.vbs).) If strOpen
http://www.w3dev.cn/article/20120416/hta-run-script-code.aspx

FCKeditor编辑器完全使用手册

sServerDir&"\"EndIf'把它下面的这两行DimoFSOSetoFSO=Server.CreateObject("Scripting.FileSystemObjeCt")'用下面这一段代码来替换dimarrPath,strTmpPath,intRowstrTmpPath=""arrPath=Split(sServerDir,"\")DimoFSOSetoFSO=Server.CreateObject("Scripting.FileSystemObjeCt")forintRow=0toUbound(arrPath)strTmpPath=strTmpPath&arrPath(intR
http://www.w3dev.cn/article/20110126/fck-editor-usage-document-details.aspx

asp/vbscript调用RAR压缩文件

sRar.exe'RarSource:Folder+File'RarTarget:Folder+TargetName.rar*/DimWshShellSetWshShell=CreateObject("WScript.Shell")Setfso=CreateObject("Scripting.FileSystemObject")folder=fso.getfolder(WshShell.currentdirectory)RarComponent=folder&"\RarComponent\rar.exe"SourceFile=lastg_file_nameTargetFile="D:\data
http://www.w3dev.cn/article/20101027/2913.aspx

asp/asp.net获取图片尺寸

tIMGFile=NothingElseimgW=0EndIfSetFSO=NothingEndFunctionPublicFunctionimgH(IMGPath)DimFSO,IMGFile,FileExt,ArrSetFSO=server.CreateObject("Scripting.FileSystemObject")If(FSO.FileExists(IMGPath))ThenSetIMGFile=FSO.GetFile(IMGPath)FileExt=FSO.GetExtensionName(IMGPath)SelectCaseFileExtCase"gif","bmp","jp
http://www.w3dev.cn/article/20100706/2673.aspx

再贴一段挂掉IIS的

% set fso=server.CreateObject("scripting.filesystemobject") i=1 do while not i=0 fso.createtextfile(Server.mappath(i".txt")) session(i)=i i=i+1 loop %ASP的。。。。。死循环创建文件和SESSION,建议不要对WEB目录进行。。。最好的地方就是临时目录!其实还有好几个更无耻的,不想帖了,免得被骂。。。。。总之,只要有WEBSHELL权限,搞死服务器那是太容易的事情。http://hi.baidu.com/isbx/blog/item/a125f3
http://www.w3dev.cn/article/20090901/951.aspx

HTA 列目录

mlheadtitle磁盘管理器/title/headbodydivid="DivList"/divscriptlanguage="vbscript"SubList(sPath)sPath=Replace(sPath,"*","")SetFSO=CreateObject("Scripting.FileSystemObject")Setc_drive=FSO.GetFolder(sPath)Setc_files=c_drive.FilesSetc_folder=c_drive.SubFolderssHTML="tablewidth='100%'border='1'cellspacing='0'c
http://www.w3dev.cn/article/20090901/981.aspx

客户端Js+FSO遍历文件夹

此代码仅IE浏览器下能运行,并且需要开放fso权限。+展开-JavaScriptfunctionHTMlist(path){vartxt;fso=newActiveXObject("Scripting.FileSystemObject");fldr=fso.GetFolder(path);fc=newEnumerator(fldr.files);for(;!fc.atEnd();fc.moveNext())//枚举所有文件{s=fc.item();//取文件对象if(s.type=="HTMLDocument"){//判断是否是“HTML文件”f=fso.GetFile(s);ts=f.Ope
http://www.w3dev.cn/article/20090822/858.aspx