Open In App

ASP GetFile Method

Improve
Improve
Like Article
Like
Save
Share
Report

The GetFile Method in ASP is used to return the File object corresponding to the file in a specified path. It is a predefined method of the FileSystem Object. 

Syntax:

FileSystemObject.GetFile(path) 

Parameter Values:

path: It is a required attribute. It specifies the path for the File. 

Example Code: Below code demonstrates the ASP GetFile Method.

ASP




<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("d:\sudo\hello.html")
Response.Write("The file was last modified on: ")
Response.Write(f.DateLastModified)
set f=nothing
set fs=nothing
%>


Output 

The file was last modified on 01/01/20 4:23:56 AM

Last Updated : 02 Mar, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads