web 2.0

ASP DateCreated() - File Object

ASP DateCreated() - File Object This the tutorial/example asp script how to Get file properties and datecreated.

ShotDev Focus:
- ASP & Get file properties and datecreated.

Example

asp_file_datecreated.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim objFSO, objFile
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(Server.MapPath("MyFiles/shotdev.txt"))
Response.Write "Attributes : " & objFile.Attributes &  "<br>"
Response.Write "Name : " & objFile.Name & "<br>"
Response.Write "Drive : " & objFile.Drive & "<br>"
Response.Write "ShortName : " & objFile.ShortName &  "<br>"
Response.Write "Size : " & objFile.Size & " bytes  <br>"
Response.Write "Type : " & objFile.Type & "<br>"
Response.Write "Path : " & objFile.Path & "<br>"
Response.Write "ParentFolder : " & objFile.ParentFolder  & "<br>"
Response.Write "ShortPath : " & objFile.ShortPath &  "<br>"
Response.Write "DateCreated : " & objFile.DateCreated &  "<br>"
Response.Write "DateLastAccessed : " & objFile.DateLastAccessed  & "<br>"
Response.Write "DateLastModified : " & objFile.DateLastModified  & "<br>"
Set objFSO = Nothing
Set objFile = Nothing
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_file_datecreated.asp

Screenshot

ASP & Get file properties and datecreated.
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

One Response to “ASP DateCreated() - File Object”

  1. 3embarrass…

Leave a Reply

You must be logged in to post a comment.