Source Code

 Green Text = Server-Side Script or a line with Server-Side Script contained within
--------------------------------------------------------------
<%@ LANGUAGE="VBSCRIPT" %>
<% 
	'--- Module: DRIVES.ASP
	'---
	'--- Display drive information using FileManager
	'---
	'--- Copyright (c) 2004 SoftArtisans, Inc.
	'--- Mail: info@softartisans.com   http://www.softartisans.com
	Option Explicit
%>
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>SoftArtisans Product Demos</TITLE>
<!-- Dennis's ASP script inside HEAD tag -->
<!--#Include Virtual="includes/script.inc" -->
<!-- SoftArtisans style sheet -->
<LINK rel="STYLESHEET" type="text/css" href="/includes/sastyle.css">
</HEAD>
<BODY topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bottommargin="0"> 
<TABLE width=650 VALIGN=top cellpadding=0 cellspacing=0 border=0> 
  <TR> 
    <TD height=100% valign=top> 
      <!-- body of page --> 
      <TABLE width=650 cellpadding=0 cellspacing=0> 
        <TR> 
          <TD width=* valign=top height=100%> 
            <TABLE width=100% height=100% cellpadding=10 cellspacing=0> 
              <TR> 
                <TD valign=top> 
                  <!-- content of page --> 
                  <H1><IMG src="../../images/logoSA_FileManager.gif" align=right alt="SoftArtisans FileManager">SoftArtisans
                    FileManager<BR> 
                    Drive Information Example</H1> 
                  <P><B>SoftArtisans FileManager</B> is a file
                    management control that enhances file manipulation.
                    This product is fully compliant with Microsoft's
                    Scripting.FileSystemObject (the component
                    often used to access the server's file system),
                    while increasing performance and adding many
                    sophisticated features.</P> 
                  <P>This sample shows information about all
                    drives on the server where this demo is running.</P> 
                  <CENTER> 
                    <TABLE border="0" cellpadding=10 cellspacing=1> 
                      <%
	Dim oFM
	Dim oDrives
	Dim oDrive
	Dim sFont
	Dim sEFont
	Dim val

	'---
	'--- Change these settings to customize this example
	'---
	sFont = "<FONT FACE=""Verdana, Arial, Helvetica, sans-serif"">"
	'---
	'--- End of customized settings
	'---
	sEFont = "</FONT>"

	Set oFM = Server.CreateObject( "SoftArtisans.FileManager" )

	' Get the Drive collection
	Set oDrives = oFM.Drives
	
	Response.Write("<TR><TD bgcolor=#003366><FONT color=#FFFFFF><B>DriveLetter</B></FONT></TD>")
	Response.Write("<TD bgcolor=#003366><FONT color=#FFFFFF><B>RootFolder</B></FONT></TD><TD bgcolor=#003366><FONT color=#FFFFFF><B>AvailableSpace</B></FONT></TD><TD bgcolor=#003366><FONT color=#FFFFFF><B>FreeSpace</B></FONT></TD><TD bgcolor=#003366><FONT color=#FFFFFF><B>TotalSize</B></FONT></TD>")
	Response.Write("<TD bgcolor=#003366><FONT color=#FFFFFF><B>FileSystem</B></FONT></TD><TD bgcolor=#003366><FONT color=#FFFFFF><B>IsReady</B></FONT></TD></TR>")

	On Error Resume Next

	For each oDrive in oDrives
		Response.Write ("<TR>")

		val = "N/A"
		val = oDrive.DriveLetter
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

		val = "N/A"
		val = oDrive.RootFolder
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

		val = "N/A"
		val = oDrive.AvailableSpace
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

		val = "N/A"
		val = oDrive.FreeSpace
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

		val = "N/A"
		val = oDrive.TotalSize
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

		val = "N/A"
		val = oDrive.FileSystem
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

		val = "N/A"
		val = oDrive.IsReady
		Response.Write ("<TD bgcolor=#DDDDDD>" & sFont & val & sEFont & "</TD>")

	Next
%> 
                    </TABLE> 
                  </CENTER> 
                  <P><A href="<%=vroot%>viewsrc.asp?Path=<%=vroot%>FileManagement/FileManager/Drives.asp" target="source">View
                      the Source Code</A></P> 
                  <!-- Copyright footer --> 
                  <!--#Include Virtual="includes/Footer.inc" --> 
                </TD> 
              </TR> 
            </TABLE> 
          </TD> 
        </TR> 
      </TABLE> 
    </TD> 
  </TR> 
</TABLE> 
</BODY>
</HTML>