FSO Use Tutorial 8--How to use the FSO to determine whether a file exists

Source: Internet
Author: User
fso| Tutorial | Is there

How to use the FSO to determine if a file exists-fso use tutorial 8

There are WriteLine and write two ways to write data to a file, which is described in detail in the following two ways of using:

Viii. How to use the FSO to determine whether a file exists:

Method: FileExists

Call Format: (right file exists, then return x equals True, otherwise equal to false)

X = FileSystemObject name. FileExists (filename)


SOURCE Example: (check to see if File1.txt exists in the same directory as the ASP file)

<%
'=================================================
' Author: Arisisi
' URL: http://www.alixixi.com/
' Source: FSO to determine whether there are examples of files
' Time: December 17, 2005
'=================================================
Set fs = Server.CreateObject ("Scripting.FileSystemObject")
File = Server.MapPath ("File1.txt")
If FS. FileExists (file) Then ' Determine if File1.txt file exists
Response.Write File & "files exist"
Else
Response.Write File & "Files do not exist"
End If
%>



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.