Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2005, 02:56 AM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default I need help with FileSystemObject ... PLEASE

i am not sure if i understand the assignment that says "

----------------------------------------------------------------------
'1. Connect to the folder that was listed on the sheet (w:\boseo\)
fso.GetFolder

'There are probably going to be several folders and files so I will have to loop through
    ' these items to find just the text files

2.
        'Start loop
3. 'If this is a text file...
4. 'Write the name of the file to the screen
5. 'I may need use this file name later (hint) so goahead and put it in
                ' a variable so we can call it on the page...
6. 'End loop

-------------------------------------------------------------------
i tried to program in this code but he said its not right. i don't understand to read this instruction above... pleaes help me.. thanks...

-------------------------------------------------------------------
<%@ Language=VBScript %>
<% Option Explicit %>

<HTML>
<BODY>
<%
Sub AddNewFolder(w:\boseo, foldername)
Dim fso, f, ts

Set fso = Server.CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder("w:\boseo")


If fso.getfolder("w:\boseo") = true then
   set f = fso.CreateTextFile("w:\boseo\hello.txt")
Else
   set f= fss.openFile("w:\boseo\hello.txt")
 End If

%>

</BODY>
</HTML
----------------------------------------------------
I tried this code but he told me its not correct... i still don't understand his instruction.... pleaes help me out... thanks...
-------------------------------------------------------------

<%@ Language=VBScript %>
<% Option Explicit %>

<HTML>
<BODY>
<%
Sub AddNewFolder(w:\boseo, foldername)
Dim fso, f, fc, ts, nf

Set fso = Server.CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder("w:\boseo")
set fc = f.subfolders

If fso.getfolder("w:\boseo") <> "" then
   set nf = fc.add(w:\boseo)
Else
   set nf = fc.add("w:\boseo\hello.txt")
 End If
End Sub
%>

</BODY>
</HTML
----------------------------------------
he said above is not right he said i didn't understand the concepts and follow his instructions....... please help me out... thanks lots...


any idea or suggestion?... please post correct codes here so i can understand better.. thanks thanks thankst hanks lots lots......







Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSystemObject not available mega Classic ASP Professional 1 June 19th, 2006 10:25 AM
Need Help about FileSystemObject vbpratap VB.NET 0 March 3rd, 2006 06:40 AM
Using the FileSystemObject malhyp Dreamweaver (all versions) 1 October 2nd, 2005 07:00 AM
FileSystemObject Gennady Classic ASP Components 6 June 17th, 2003 08:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.