cheap nfl jerseys china cheap nfl jerseys free shipping wholesale nfl jerseys china wholesale jerseys from china cheap nfl jerseys free shipping cheap nfl jerseys for sale cheap jerseys free shipping wholesale nfl jerseys from china cheap nfl jerseys sale cheap nike nfl jerseys china wholesale jerseys free shipping cheap nfl jerseys wholesale wholesale nfl jerseys online cheap nfl jerseys wholesale china jerseys wholesale cheap coach handbags outlet authentic designer handbags cheap coach handbags outlet cheap coach purses outlet discount coach bags coach bags sale coach purse outlet cheap real coach purses coach handbags sale online coach purse outlet michael kors outlet online store cheap michael kors bags cheap michael kors purse michael kors factory outlet online cheap michael kors handbags cheap michael kors purses michael kors bags outlet online cheap michael kors purse michael kors handbags discount
accesso ai file

Dim objFileSystem Set objFileSystem = CreateObject("Scripting.FileSystemObject")

esistenza

if objFileSystem.FolderExists("nome") if objFileSystem.FileExists(Server.MapPath("nomefile"))

oggetto file

propriet�: Drive, Name, Path, ParentFolder, ShortName, ShortPath, DataCreated, DateLastAccessed, DateLastModified, Type, Size, Attributes

oggetto folder

propriet�: le stesse di file, pi� Files e Subfolders (collection), IsRootFolder (boolean), ParentFolder (istanza dell'oggetto folder)

... Set objFile = objFileSystem.GetFile(Server.MapPath("nomefile")) ResponseWrite "il file � stato modificato " & objFile.DateLastModified

file in una directory: la collezione Files

<%@ Language=VBscript %> <% Option Explicit %> <HTML><BODY> <% Dim objFileSystem, objFolder, objFile Set objFileSystem = CreateObject("Scripting.FileSystemObject") Set objFolder = objFileSystem.GetFolder(Server.MapPath("nomedir")) Response.Write "file in " & objFolder.Path & ":<BR>" For Each objFile in objFolder.Files Response.Write objFile.Nome & "<BR>" Next Set objFolder = Nothing Set objFileSystem = Nothing %>

creare file

Dim objFileSystem, objNewFile Set objFileSystem = CreateObject("Scripting.FileSystemObject") If Not objFileSystem.FileExist(Server.MapPath("nomefile")) then Set objNewFile = objFileSystem.CreateTextFile(Server.MapPath("nomefile"),False) End If

aprire file

Dim objFileSystem, objOpenFile, strPath Set objFileSystem = CreateObject("Scripting.FileSystemObject") strPath=Server.MapPath("nomefile") Set objOpenFile = objFileSystem.OpenTextFile(strPath,1) Dim objFileSystem, objFile, objOpenFile Set objFileSystem = CreateObject("Scripting.FileSystemObject") Set objFile = objFileSystem.GetFile(Server.MapPath("nomefile")) Set objOpenFile = objFile.OpenAsTextStream(ForReading)

leggere file

Read, ReadLine, ReadAll leggono caratteri, righe o tutto

... aprire il file Do While Not objOpenFile.AtEndOfStream ' legge 80 caratteri alla volta Response.Write objOpenFile.ReadLine & "<BR>" Loop ... chiudere il file e gli oggetti

visualizzare un file asp

<%@ Language=VBscript %> <% Option Explicit %> <HTML><BODY> <% Dim objFileSystem, objOpenFile, strPath, strText strPath=Request.QueryString("URL") strPath=Server.MapPath(strPath) Set objFileSystem = CreateObject("Scripting.FileSystemObject") Set objOpenFile = objFileSystem.OpenTextFile(strPath,1) ' 1=ForReading Response.Write "<PRE>" Do While Not objOpenFile.AtEndOfStream strText=objOpenFile.ReadLine Response.Write Server.HTMLEncode(strText) & "<BR>" Loop Response.Write "</PRE>" objOpenFile.close Set objOpenFile = Nothing Set objFileSystem = Nothing %>

scrivere file

Write, WriteLine

<%@ Language=VBscript %> <% Option Explicit %> <HTML><BODY> <% Dim objFileSystem, objOpenFile, strPath, strText strPath=Request.QueryString("URL") strPath=Server.MapPath(strPath) Set objFileSystem = CreateObject("Scripting.FileSystemObject") Set objOpenFile = objFileSystem.OpenTextFile(strPath,2) ' 2=ForWriting objOpenFile.WriteLine("abcdefg") objOpenFile.close Set objOpenFile = Nothing Set objFileSystem = Nothing %>

contatore n. di visite

<%@ Language=VBscript %> <% Option Explicit %> <HTML><BODY> <% Dim objFileSystem, objOpenFile, strPath, strText strPath=Request.QueryString("pagina") & ".txt" strPath=Server.MapPath(strPath) Set objFileSystem = CreateObject("Scripting.FileSystemObject") If objFileSystem.FileExists(strPath) then Set objOpenFile = objFileSystem.OpenTextFile(strPath,1) ' 1=ForReading iCount=Cint(objOpenFile.ReadLine)+1 objOpenFile.close Else iCount=1 End If Set objOpenFile = objFileSystem.CreateTextFile(strPath,True) ' True=sovrascrivi objOpenFile.WriteLine(iCount) objOpenFile.close Set objOpenFile = Nothing Set objFileSystem = Nothing Response.Redirect(Request.QueryString("URL")) %>

appendere a un file

Set objOpenFile = objFileSystem.OpenTextFile(strPath,ForAppending)