There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
black screen blue screen blue screen of death boot computer connection crash css dell display driver drivers error excel firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem ram router slow software sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
FileSystemObject -- Help Please


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
xanderxvr's Avatar
Junior Member with 3 posts.
 
Join Date: Jan 2005
Experience: Beginner
31-Jan-2005, 04:24 AM #1
FileSystemObject -- 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

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......
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
31-Jan-2005, 10:20 AM #2
You have not looped through any folders looking for the text files. There are some good tutorials on the internet if you Google for them. Here is a desciption of all of the FSO Objects:
http://www.juicystudio.com/tutorial/....asp#fsoobject
xanderxvr's Avatar
Junior Member with 3 posts.
 
Join Date: Jan 2005
Experience: Beginner
01-Feb-2005, 02:11 PM #3
ASP Help Please
dim f2
'dim ts
Set f2 = fso.GetFile("w:\boseo\" & strFile)
Set ts = f2.OpenAsTextStream(1,-2)

do while ts.AtEndOfStream = False
Response.Write ts.ReadLine & "<BR>"

'(how can i collect the vaues from the file and put them in the right order? How can i create a variable to store all the data in and then i can just call that variable later?)

loop
--------------------------------
how can i collect the vaues from the file and put them in the right order?

How can i create a variable to store all the data in and then i can just call that variable later?
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
02-Feb-2005, 01:55 PM #4
There isn no way to sort them unless you loop through the folders and then the files. I saw one piece of code at one time that allowed for sorting but it was wayyyy to cumbersome. You already have the variable named ts for your text stream.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:09 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.