You can create files on the visitor's hard drive through the browser, because I first tried it and it worked. If you don't believe me, COPY the following code into an HTML file and run it again!
Did you find that the Autoexec.bat file on your C drive is missing? Haha, actually when that file is run, IE will remind you that the ActiveX control you are currently using is unsafe and ask you whether to run it, but since you are as eager as me to try out the effect, you will press [OK] without hesitation. .... In fact, this is implemented using FileSystemObject. If you want to know more detailed usage and examples, click here to download the Chinese documentation of JScript or buy a copy of <
> You can also take a look at the examples compiled by Wuyou Script for everyone to learn. Let us first take a look at what attributes and functions are available, and then we will make some small examples of some functions
Method or attribute description
BuildPath()
Generate a file path
CopyFile() Copy file
CopyFolder() Copy a directory
CreateFolder() Create a new directory
CreateTextFile() Generate a file
DeleteFile() Delete a file
DeleteFolder() Delete a directory
DriveExists() Check whether the drive letter exists
Drives Return the set of drive letters
FileExists() Check whether the file exists
FolderExists Check whether a directory exists
GetAbsolutePathName() Get the absolute path of a file
GetBaseName( ) Get the file name
GetDrive() Get the drive letter name
GetDriveName() Get the drive letter name
GetExtensionName() Get the file suffix
GetFile() Generate the file object
GetFileName() Get File name
GetFolder() Get the directory object
GetParentFolderName Get the parent directory name of the file or directory
GetSpecialFolder() Get the special directory name
GetTempName() Generate a temporary file object
MoveFile( ) Move files
MoveFolder() Move directories
OpenTextFile()
Open a file stream instance description BuildPath(path, file name) //This method will add to the given path Upload the file and automatically add delimiters
CopyFile(source File, target file, overwrite) //Copy the source file to the target file. When the overwrite value is true, the file will be overwritten if the target file exists
CopyFolder(object directory, target directory, overwrite) //Copy the object directory to the target directory. When overwrite is true, the file will be overwritten if the target directory exists
CreateFolder(directory name) //Create a new directory
CreateTextFile(file name, overwrite) //Create a new file. If the file already exists, you need to set the overwrite value to true
DeleteFile(file name, read-only?) //Delete a file. If the file attribute is read-only, you need to set the read-only value to true
DriveExists(drive letter) //Check whether a drive exists, if it exists, it will return true, if it does not exist, it will return...
FileExists(file name) //Check whether a file exists, and return true if it exists , return if it does not exist...
FolderExists(directory name) //Check whether a directory exists, if it exists Returns true, returns if it does not exist...
GetBaseName(file object) //Return to file The file name of the object
GetExtensionName (file object) //The suffix of the file
GetParentFolderName (file object) //Get the parent directory name
GetSpecialFolder(directory code) //Get the paths to some special directories in the system. There are three directory codes: 0: Directory where Windows is installed 1: System file directory 2: Temporary file directory
GetTempName( ) //Generate a random temporary file object, starting with rad followed by some random numbers, just like some software will generate *.tmp during installation
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn