Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - FSO - Get folder names
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

FSO - Get folder names

 Post Reply Post Reply
Author
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Topic: FSO - Get folder names
    Posted: 13 January 2004 at 1:21pm

yo..

i have this code for getting file names:

Function SkinSelect(strType)  'Link - Textlinks, Drop - Dropdown list

 Response.Write("<div align=""center"">")
 
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFolder = objFSO.GetFolder(Server.MapPath("skin_files\"))

  intNumOfSkins = CInt((objFolder.Files.Count - 1) / 2)

  If intNumOfSkins = 1 Then Response.Write(intNumOfSkins & strTxtSkinInstalled & ".") Else Response.Write(intNumOfSkins & strTxtSkinsInstalled & ".")

  If intNumOfSkins > "0" Then

   If strType = "Drop" Then

    Response.Write("<br />")
    Response.Write("<select size=""1"" name=""skin"">")
    Response.Write("<option selected>---" & strTxtSelectSkin & "---</option>")

    For Each objFile In objFolder.Files

     If Right(objFile.Name, 5) = ".skin" Then

      Set objTextStream = objFSO.OpenTextFile(Server.MapPath("skin_files\" & objFile.Name))
      objTextStream.ReadLine

      Response.Write("<opti on value=""" & objFSO.GetBaseName(objFile) & """>")
      Response.Write(objTextSt ream.ReadLine)
      Response.Write("</opt ion>")

      objTextStream.Close
      Set objTextStream = Nothing
     
     End If

    Next

    Response.Write("</select>")

   ElseIf strType = "Link" Then

    Response.Write("<br />")

    For Each objFile In objFolder.Files

     If Right(objFile.Name, 5) = ".skin" Then

      Set objTextStream = objFSO.OpenTextFile(Server.MapPath("skin_files\" & objFile.Name))
      objTextStream.ReadLine

      Response.Write("-<a href=" & Request.ServerVariables("URL") & "?Skin=" & objFSO.GetBaseName(objFile) & ">")
      Response.Write(objTextSt ream.ReadLine)
      Response.Write("</a&g t;-<br />")

      objTextStream.Close
      Set objTextStream = Nothing
     
     End If

    Next

   End If

  End If

  Set objFolder = Nothing
  Set objFSO = Nothing

 Response.Write("</div>")
 
End Function

 

what i wanted to knwo, how can i get the folder names the same way? (what should i use instead of objFolder.Files?

 

sorry if this have been answered here before, but i couldnt manage to find it..

Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2004 at 1:50pm
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2004 at 1:54pm

oh.. ive missed that tutorial!

thanks KC

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.