www.fingertip.page.tl or www.fingertip.us.tt - ASP-3
   
www.fingertip.us.tt
  Index
  Free WebHost&DNS
  Hardware&Networking
  Red Hat Enterprise Linux 5
  Active Server Page2.0
  => Active Server Pages2.0
  => ASP-1
  => ASP-1.1
  => ASP-2
  => ASP-3
  => ASP-4
  => ASP-5
  Database Coding Standards
  .Net Platform
  Link Website
  Online Game
  Satellite Image Home
  Download Toolbar
  Other
  WebMaster
  Counter
  SiteMap
  Guestbook
  To Contact Us
  IT People
  Website Grade
  Learn English
  Donate Money
  Comrades
  Free Dictionary
  VaaHOO

www.e-comwebsite.blogspot.com

 

Search for
 
Get the name of a specified drive

 

<html>
<body>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
p=fs.GetDriveName("c:winntcursors3dgarro.cur")

Response.Write("The drive name is: " & p)

set fs=nothing
%>


</body>

</html>


Get the name of the parent folder of a specified path

<html>
<body>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
p=fs.GetParentFolderName("c:winntcursors3dgarro.cur")

Response.Write("The parent folder name of c:winntcursors3dgarro.cur is: " & p)

set fs=nothing
%>


</body>
</html>


Get the file extension

<html>
<body>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Response.Write("The file extension of the file 3dgarro is: ")
Response.Write(fs.GetExtensionName("c:winntcursors3dgarro.cur"))

set fs=nothing
%>


</body>
</html>


Get the base name of a file or folder

 

<html>
<body>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Response.Write(fs.GetBaseName("c:winntcursors3dgarro.cur"))
Response.Write("<br />")
Response.Write(fs.GetBaseName("c:winntcursors"))
Response.Write("<br />")
Response.Write(fs.GetBaseName("c:winnt"))

set fs=nothing
%>


</body>
</html>

 

 

TextStream Object

Read textfile

<html>
<body>
<p>This is the text in the text file:</p>
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
Response.Write(f.ReadAll)
f.Close

Set f=Nothing
Set fs=Nothing
%>

</body>
</html>

 

 


Read only a part of a textfile

<html>
<body>
<p>This is the first five characters from the text file:</p>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
Response.Write(f.Read(5))
f.Close

Set f=Nothing
Set fs=Nothing
%>


</body>
</html>


Read one line of a textfile

<html>
<body>
<p>This is the first line of the text file:</p>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
Response.Write(f.ReadLine)
f.Close

Set f=Nothing
Set fs=Nothing
%>


</body>
</html>


Read all lines from a textfile

<html>
<body>
<p>This is all the lines in the text file:</p>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)

do while f.AtEndOfStream = false
Response.Write(f.ReadLine)
Response.Write("<br>")
loop

f.Close
Set f=Nothing
Set fs=Nothing
%>


</body>
</html>


Skip a part of a textfile

<html>
<body>
<p>The first four characters in the text file are skipped:</p>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
f.Skip(4)
Response.Write(f.ReadAll)
f.Close

Set f=Nothing
Set fs=Nothing
%>


</body>
</html>


Skip a line of a textfile

<html>
<body>
<p>The first line in the text file is skipped:</p>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
f.SkipLine
Response.Write(f.ReadAll)
f.Close

Set f=Nothing
Set fs=Nothing
%>


</body>
</html>


Return current line-number in a text file

<html>
<body>
<p>This is all the lines in the text file (with line numbers):</p>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)

do while f.AtEndOfStream = false
Response.Write("Line:" & f.Line & " ")
Response.Write(f.ReadLine)
Response.Write("<br>")
loop

f.Close
Set f=Nothing
Set fs=Nothing
%>


</body>
</html>


Get column number of the current character in a text file

 

<html>
<body>

<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("testread.txt"), 1)
Response.Write(f.Read(2))
Response.Write("<p>The cursor is now standing in position " & f.Column & " in the text file.</p>")
f.Close

Set f=Nothing
Set fs=Nothing
%>


</body>
</html>

 

 

Drive Object

Get the available space of a specified drive

<html>
<body>

<%
Dim fs, d, n
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set d=fs.GetDrive("c:")
n = "Drive: " & d
n = n & "<br>Available Space in bytes: " & d.AvailableSpace
Response.Write(n)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the free space of a specified drive

<html>
<body>

<%
Dim fs, d, n
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set d=fs.GetDrive("c:")
n = "Drive: " & d
n = n & "<br />Free Space in bytes: " & d.FreeSpace
Response.Write(n)
set d=nothing
set fs=nothing
%>


</body>
</html>

 

 


Get the total size of a specified drive

<html>
<body>

<%
Dim fs,d,n
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set d=fs.GetDrive("c:")
n = "Drive: " & d
n = n & "<br>Total size in bytes: " & d.TotalSize
Response.Write(n)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the drive letter of a specified drive

<html>
<body>

<%
dim fs, d, n
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The drive letter is: " & d.driveletter)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the drive type of a specified drive

<html>
<body>

<%
dim fs, d, n
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The drive type is: " & d.DriveType)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the file system of a specified drive

<html>
<body>

<%
dim fs, d, n
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The file system is: " & d.FileSystem)
set d=nothing
set fs=nothing
%>


</body>
</html>


Is the drive ready?

<html>
<body>

<%
dim fs,d,n
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
n = "The " & d.DriveLetter
if d.IsReady=true then
    n = n & " drive is ready."
else
    n = n & " drive is not ready."
end if
Response.Write(n)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the path of a specified drive

<html>
<body>

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The path is " & d.Path)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the root folder of a specified drive

<html>
<body>

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The rootfolder is " & d.RootFolder)
set d=nothing
set fs=nothing
%>


</body>
</html>


Get the serialnumber of a specified drive

<html>
<body>

<%
dim fs,d
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("c:")
Response.Write("The serialnumber is " & d.SerialNumber)
set d=nothing
set fs=nothing
%>


</body>
</html>

Locations of visitors to this page 






Add comment to this page:
Your Name:
Your Email address:
Your website URL:
Your message:

   

=> Do you also want a homepage for free? Then click here! <=