Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Accessing files with FSO (FileSystemObject)


Message #1 by "Joseph Janick" <joseph_janick@u...> on Tue, 4 Feb 2003 18:28:07
Since I'm a beginner, I figure it's safe to discuss this subject here, 
even though it's not part of the books for beginners.  If this needs to be 
moved to a more advanced group, I'd understand.  Anyway, here it goes.

I'm trying to set up a procedure where through the pressing of a button, 
info is accessed from (a table regarding) files and displayed in textboxes 
{mainly the file name and location}.  Use of the FileSystemObject has been 
mandated.  I'm trying to use the Help feature in Visual Studio to try and 
code this out, but it's not terribly helpful.  Any ideas?
Message #2 by soltisa@W... on Tue, 4 Feb 2003 13:15:02 -0700
I think this is kind of what you were thinking...

<!--
<TABLE>
<TR>
	<TD colspan=4>My file archive</TD>
</TR>
<TR>
	<TD>Filename</TD>
	<TD>Size</TD>
	<TD>File type</B></TD>
	<TD>Date created</TD>
</TR>
<%
' Create an instance of the FileSystemObject
Set MyFSO=Server.CreateObject("Scripting.FileSystemObject")
' Create Folder Object
Set MyFolder=MyFSO.GetFolder(Server.MapPath("yourfoldername"))
'Loop trough the files in the folder
FOR EACH thing in MyFolder.Files
%>
<TR>
	<TD>
		<input type='text' name='text<%=thing.Name%>'
value='<%=thing.Name%>
	</TD>
	<TD>
		<%=thing.Size%> bytes
	</TD>
	<TD>
		<%=thing.Type%>
	</TD>
	<TD>
		<%=thing.DateCreated%>
	</TD> 
<TR>
<% NEXT %>
</TABLE>
-->

Alvin Soltis
PCS Center Technology
"The less you have, the less you have to worry about"


-----Original Message-----
From: Joseph Janick [mailto:joseph_janick@u...] 
Sent: Tuesday, February 04, 2003 10:28 AM
To: aspx_beginners
Subject: [aspx_beginners] Accessing files with FSO (FileSystemObject)


Since I'm a beginner, I figure it's safe to discuss this subject here, 
even though it's not part of the books for beginners.  If this needs to be 
moved to a more advanced group, I'd understand.  Anyway, here it goes.

I'm trying to set up a procedure where through the pressing of a button, 
info is accessed from (a table regarding) files and displayed in textboxes 
{mainly the file name and location}.  Use of the FileSystemObject has been 
mandated.  I'm trying to use the Help feature in Visual Studio to try and 
code this out, but it's not terribly helpful.  Any ideas?
Message #3 by "Joseph Janick" <joseph_janick@u...> on Tue, 4 Feb 2003 21:52:01
Here's where I wish I had the opportunity to edit my message and make it 
more clear.

I'm actually trying to get file info from both the folders they're in and 
a SQL table (that's what I meant by table).  I know how to do a SQL 
statement, but accessing files with FSO is another matter; and for 
department standards, the VB has to be separate from the ASP, plus I need 
to use ASP server controls and not HTML controls.  That's what I was 
thinking, except that I don't think straight sometimes.

> I think this is kind of what you were thinking...

<!--
<TABLE>
<TR>
	<TD colspan=4>My file archive</TD>
</TR>
<TR>
	<TD>Filename</TD>
	<TD>Size</TD>
	<TD>File type</B></TD>
	<TD>Date created</TD>
</TR>
<%
' Create an instance of the FileSystemObject
Set MyFSO=Server.CreateObject("Scripting.FileSystemObject")
' Create Folder Object
Set MyFolder=MyFSO.GetFolder(Server.MapPath("yourfoldername"))
'Loop trough the files in the folder
FOR EACH thing in MyFolder.Files
%>
<TR>
	<TD>
		<input type='text' name='text<%=thing.Name%>'
value='<%=thing.Name%>
	</TD>
	<TD>
		<%=thing.Size%> bytes
	</TD>
	<TD>
		<%=thing.Type%>
	</TD>
	<TD>
		<%=thing.DateCreated%>
	</TD> 
<TR>
<% NEXT %>
</TABLE>
-->

Alvin Soltis
PCS Center Technology
"The less you have, the less you have to worry about"

  Return to Index