Monday 21, May 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    About Us    |    Contact Us

ASP File

All file interactions in ASP are done through the File System Object that is included with IIS. It is used to to manipulate files, folders, and directory paths.

The FileSystemObject

The FileSystemObject object is used to access the file system on a server. The FileSystemObject can be used to manipulate files, folders, and directory paths. Here is an example code for creating a text file.

<%

dim fsObj,filename
set fsObj=Server.CreateObject("Scripting.FileSystemObject")
set filename= fsObj.CreateTextFile("d:\testing.txt",true)
filename.WriteLine("Hello World!")
filename.Close
set filename =nothing
set fsObj=nothing

%>

The File Object

The File object is used to return information about a specified file. To retrieve a File Object in ASP you must know the relative or complete file path to the desired file.

<%

Dim fsObj,fileInfo
Set fsObj=Server.CreateObject("Scripting.FileSystemObject")
Set fileInfo=fsObj.GetFile("c:\testing.txt")
Response.Write("File created: " &fileInfo.DateCreated)
set fileInfo=nothing
set fsObj =nothing

%>

The Folder Object

The Folder object is used to return information about a specified folder. You must provide the complete or relative path of the folder to get the Folder object.

<%

Dim fsObj, folderObj
Set fsObj = Server.CreateObject("Scripting.FileSystemObject")
Set folderObj= fsObj.GetFolder("c:\testfolder")
Response.Write("Current folder is: " & folderObj.Name)

For Each fileItem In folderObj.Files
    Response.Write("<br />" & fileItem.Name)
Next

Set myFolderO = nothing
Set fsObj= nothing

%>

 
     
   
ASP Tutorial
 
  ASP Introduction
ASP Introduction
  ASP Syntax
ASP Syntax
  ASP JavaScript
ASP JavaScript
  ASP Variables
ASP Variables
  ASP Arrays
ASP Arrays
  ASP If Statement
ASP If Statement
  ASP Procedures
ASP Procedures
  ASP Functions
ASP Functions
  ASP Sessions
ASP Sessions
  ASP Cookies
ASP Cookies
  ASP Application Object
ASP Application Object
  ASP Forms
ASP Forms
  ASP Comments
ASP Comments
  ASP Email
ASP Email
  ASP ADO
ASP ADO
  ASP File
ASP File
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download Dotcomology Ebook Dotcomology
   
Download Article Marketing Made Easy Ebook Article Marketing Made Easy
   
Download IM Marketing Miracle Ebook IM Marketing Miracle
   
Download BMA s Internet Marketing Articles Vol I  Ebook BMA s Internet Marketing Articles Vol I
   
Download Credit Made EZ  Ebook Credit Made EZ
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz