473,326 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Server file space monitoring

Hi.

Does anyone know of a simple asp script that can check free disk space and send an email to someone when low disk space occurs? I
am not familiar with asp. I am from a php background but our server doesn't support php only asp.

Thanks

Laurie

Nov 18 '05 #1
1 1302
This much in ASP.NET will return the disk free space using VB.NET :

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Response.Write(free_space("c:\").ToString)
End Sub

<DllImport("Kernel32.dll")> _
Public Shared Function GetDiskFreeSpaceEx _
(ByVal lpszPath As String, _
ByRef lpFreeBytesAvailable As Long, _
ByRef lpTotalNumberOfBytes As Long, _
ByRef lpTotalNumberOfFreeBytes As Long) As Boolean
End Function

Public Function free_space _
(ByVal folder_name As String) As Long
Dim free As Long = 0
Dim dummy1 As Long = 0
Dim dummy2 As Long = 0

If GetDiskFreeSpaceEx _
(folder_name, free, dummy1, dummy2) Then
Return free
Else
Return -1
End If
End Function 'free_space

Ken
Microsoft MVP [ASP.NET]

"laurie" <la****@hotmail.com> wrote in message
news:Xh****************@newsfe2-gui.server.ntli.net...
Hi.

Does anyone know of a simple asp script that can check free disk space and
send an email to someone when low disk space occurs? I
am not familiar with asp. I am from a php background but our server
doesn't support php only asp.

Thanks

Laurie


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Prashant Thakwani | last post by:
Consider a scenario, I am a DBA for the Database server where the size of the hard disk is 100 GB. On that database server, i have the Database whose size is 40 GB. Also, i restrict the size of...
1
by: Curtis Justus | last post by:
Hi, We have a project that requires a .NET service to convert a Word document to a PDF document. Basically, a person would create a mail merge template in Word and through automation, we merge...
1
by: laurie | last post by:
Hi. Does anyone know of a simple asp script that can check free disk space and send an email to someone when low disk space occurs? I am not familiar with asp. I am from a php background but our...
1
by: laurie | last post by:
Hi. Does anyone know of a simple asp script that can check free disk space and send an email to someone when low disk space occurs? I am not familiar with asp. I am from a php background but our...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.