ميزة Path في ASP
التعريف والاستخدام
استخدام Path Property ليعود إلى مسار محدد من محرك أو ملف أو مسار الملف.
التعليقات:للمحركات، المسار لا يحتوي على مجلد الجذر. على سبيل المثال، مسار محرك C هو C: وليس C:\.
النحو:
ممر DriveObject ممر FileObject ممر FolderObject
مثال
مثال على Drive Object
<%
تعريف fs,d
تعيين fs=Server.CreateObject("Scripting.FileSystemObject")
تعيين d=fs.GetDrive("c:")
Response.Write("المسار هو " & ممر d)
تعيين d=nothing
تعيين fs=nothing
%>
الناتج:
المسار هو C:
مثال على File Object
<%
تعريف fs,f
تعيين fs=Server.CreateObject("Scripting.FileSystemObject")
تعيين f=fs.GetFile("d:\asp\test\test.asp")
Response.Write("The path is: " & ممر f)
تعيين f=nothing
تعيين fs=nothing
%>
الناتج:
المسار هو: D:\asp\test\test.asp
مثال على Folder Object
<%
تعريف fs,fo
تعيين fs=Server.CreateObject("Scripting.FileSystemObject")
تعيين fo=fs.GetFolder("d:\asp\test")
Response.Write("The path is: " & fo.Path)
تعيين fo=nothing
تعيين fs=nothing
%>
الناتج:
المسار هو: D:\asp\test

