ASP ShortName and ShortPath Property Example tutorial

Source: Internet
Author: User

The ASP shortname and ShortPath properties are those that take the short name or path of the file

The ShortPath property is used to return the file or folder specified by the short path (8.3 naming convention).

Grammar
Fileobject.shortpath
Folderobject.shortpath

For example, a file object

<%
Dim fs,f
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set F=FS. GetFile ("C:asp_test_webhitcounterfile.txt")
Response.Write ("Path:" & F.path)
Response.Write ("<br/>shortpath:" & F.shortpath)
Set f=nothing
Set fs=nothing
%>
Output:
Path:c:asp_test_webhitcounterfile.txt
Shortpath:c:asp_te~1hitcou~1.txt


The same for folder operations. Let's look at the ASP FileSystemObject shortname properties.

This shortname is used to return the file or folder specified by the short name (8.3 naming convention).

Grammar
Fileobject.shortname
Folderobject.shortname

For example, a file object

<%
Dim fs,f
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set F=FS. GetFile ("C:hitcounterfile.txt"))
Response.Write ("Name:" & F.name)
Response.Write ("<br/>shortname:" & F.shortname)
Set f=nothing
Set fs=nothing
%>
Output:

Name:hitcounterfile.txt
Shortname:hitcou~1.txt
FSO ShortName properties under the Face folder instance tutorial
<%
Dim fs,fo
Set Fs=server.createobject ("Scripting.FileSystemObject")
Set FO=FS. GetFolder ("C:asp_test_web")
Response.Write ("Name:" & fo. Name)
Response.Write ("<br/>shortname:" & fo. ShortName)
Set fo=nothing
Set fs=nothing
%>output:name:asp_test_web
Shortname:asp_te~1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.