Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 29th, 2005, 06:09 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default FileSystemObject --- Urgent Help 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


        'Start loop
            'If this is a text file...
                'Write the name of the file to the screen
                '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...
        'End loop

-------------------------------------------------------------------
i tried to program in this code but he said its not right. i don't understand to read this instruction... 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....... plase help me out... thanks lots...


any idea or suggestion... please post correct code for me.. thanks thanks thankst hanks lots lots......



Reply With Quote
  #2 (permalink)  
Old February 1st, 2005, 02:34 AM
Authorized User
 
Join Date: Dec 2004
Location: hyderabad, ap, India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hai
 try with the below code.

by
murali.

<%
call AddNewFolder("d:\boseo", foldername)

Sub AddNewFolder(folderpath, foldername)
Dim fso, f, fc, ts, nf

Set fso = Server.CreateObject("Scripting.FileSystemObject")
set f = fso.GetFolder(folderpath)
set fc = f.subfolders

   set nf = fso.opentextfile(folderpath & "\hello.txt",8,true)
    nf.write "murali"
    nf.close

End Sub
%>


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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
FileSystemObject dikkjo Classic ASP Components 2 October 15th, 2003 06:50 AM
FileSystemObject Gennady Classic ASP Components 6 June 17th, 2003 08:16 AM



All times are GMT -4. The time now is 02:57 PM.


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