Open In App

ASP GetExtensionName Method

Improve
Improve
Like Article
Like
Save
Share
Report

The GetExtensionName Method in ASP is used for returning a string value that represents the extension name of the file for the last component in the specified path. It is a predefined method of the FileSystem Object. 

Syntax:

FileSystemObject.GetExtensionName(path)

Parameter Value:

  • path: It is a required attribute. It specifies the path for the component whose extension name is to be returned.

Example 1: Below example code demonstrates the GetExtensionName Method.

ASP




<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write(fs.GetExtensionName("d:\sudo\GFG.asp"))
set fs=nothing
%>


Output:

asp

Example 2: 

ASP




<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write(fs.GetExtensionName("d:\sudo\GFG.htm"))
set fs=nothing
%>


Output:

htm

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