Atrybut Type w ASP
Definicja i użycie
Atrybut Type służy do zwracania określonego typu pliku lub katalogu.
Gramatyka:
FileObject.Type FolderObject.Type
Przykład dla obiektu File
<% zmień fs,f ustaw fs=Server.CreateObject("Scripting.FileSystemObject") ustaw f=fs.GetFile("c:help.txt") Response.Write("Plik test.txt jest typu:") Response.Write("}}")f.Type) ustaw f=nothing ustaw fs=nothing %>
Wyjście:
Plik help.txt jest typu: Dokument tekstowy
Przykład dla obiektu Folder
<% zmień fs,f ustaw fs=Server.CreateObject("Scripting.FileSystemObject") ustaw f=fs.GetFile("c:help.asp") Response.Write("Plik test.asp jest typu:") Response.Write("}}")f.Type) ustaw f=nothing ustaw fs=nothing %>
Wyjście:
Plik help.asp jest typu: Aktywny Dokument Serwera