PDA

View Full Version : ASP vbs assistance



evilradish
23 Jul 2010, 06:02 AM
I am trying to put together a page that monitors files on a home nas and if they exceed a certain size the colour of the cell changes red and if its below the colour is green.

High tech stuff :laugh:

So far I have managed to report the file size and location in a cell.. but am not sure how to write the colour change part.

Code Below

Thanks:)

<html>
<head>
<title>Home File Checker</title>
</head>
<body>
<body bgcolor="silver" text="black">
<table border="1">
<font="arial">
<tr>
<td>
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("\\NAS01\Music\Music.mdb")
Response.Write("Music")
Response.Write( f.Size & "bytes.")
set f=nothing
set fs=nothing

%>
</td>
</tr>
<tr>
<td>
<%
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("\\NAS01\Video\video.mdb")
Response.Write("video ")
Response.Write(f.Size & " bytes.")
set f=nothing
set fs=nothing
%>
</td>
</tr>
</body>
</html>

evilradish
23 Jul 2010, 08:07 AM
heres my attempt at the colour change

<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("\\ukaccounts\accounts\Revenue\Product Control\CFE - EIDB Business\Database\ITB Profit and Loss DB.mdb")
Response.Write("\\ukaccounts\accounts\Revenue\Product Control\CFE - EIDB Business\Database\ITB Profit and Loss DB.mdb: ")
Response.Write( f.Size & "bytes.")
if
(f.size >= 100)
e.Row.BackColor = ColorRed;
set f=nothing
set fs=nothing


%>