Phương thức GetSpecialFolder trong ASP

Định nghĩa và cách sử dụng

Phương thức GetSpecialFolder trả về đường dẫn của thư mục đặc biệt trong Windows。

Cú pháp:

FileSystemObject.GetSpecialFolder(foldername)
Tham số Mô tả
foldername Để yêu cầu. Thư mục cần trả về.
  • 0 = WindowsFolder - Chứa các tệp được cài đặt bởi hệ điều hành Windows。
  • 1 = SystemFolder - Chứa thư viện, font và driver thiết bị。
  • 2 = TemporaryFolder - Dùng để lưu trữ tệp tạm thời。

thực thể

<%
dim fs,p
set fs=Server.CreateObject("Scripting.FileSystemObject")
set p=fs.GetSpecialFolder(1)
Response.Write(p)
set p=nothing
set fs=nothing
%>

Kết quả đầu ra:

C:\WINNT\system32