<script language = "jscript" runat = "server"> /*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--* DESCRIPTION: Outputs the contents of a text file to an html client. STATUS: working- tested 20% DOCUMENTATION: h:\LibraryCode\JavaScript\Asp\Documentation SOURCE CODE: h:\LibraryCode\JavaScript\Asp\SourceCode1\ DEPENDENCIES: fnErrorMessage [fnErrorMessage.asp] *--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*/ function fnDisplayDirectory(sFolder, sPattern) { var path; var fsoFile; var fsoObject; var sContents; //***Holds the contents of the file var bShowControlChar; if (bShowInvisible == null) {bShowControlChar = false;} else {bShowControlChar = bShowInvisible;} if (sFolder == null) { fnErrorMessage( "fnDisplayDirectory", "sFile", "The 'sFolder' parameter was omitted. This parameter is required"); } //***Note '\' is an escape character var Pattern = /^(\\)(\\)^(\\)/gi; Pattern = /\\/gi; //path = sFile.replace(Pattern, "\\\\"); path = sFolder; fsoFile = Server.CreateObject("Scripting.FileSystemObject") if (fsoFile.FolderExists(path)) { fsoObject = fsoFile.GetFolder(path); } else { fnErrorMessage( "fnDisplayDirectory", "sFolder ('" + path + "') ", "The file could not be found,<br> " + "please check the name and path "); } //***Display the file contents Response.Clear(); Response.Write( "<table width = '100%'><tr><td valign = 'top'>" + "<b>THE CONTENTS OF THE FILE</b> " + path + "<br><br>"); var iBreakCounter = 0; for (var ii = 0; ii < sContents.length; ii++) { } /* for */ fsoObject = null; fsoFile = null; } /* fnDisplayDirectory */ </script>