Moderatori: Anthony47, Flash30005
$include "rapidq2.inc"
DIM Object AS QOLEOBJECT
dim CQ as QOLEOBJECT
dim sys as QSYSTEM
dim IniFile as QFILESTREAM
dim riga as string
Dim mailmsg
declare sub SpaceCheck
declare sub SendMail
const DEFAULT_MINIMUM = 1000 ' MB
create MailerForm as Qform
top = 200
left = 100
caption = "Disk-full mail notifier"
CREATE Mailer AS QOLECONTAINER
Left = 10
Top = 10
Width=50
Height = 50
visible=false
END CREATE
create ActualFreeLabel as qlabel
top = 10
left = 10
caption = "--"
end create
create MinimumFreeLabel as qlabel
top = 30
left = 10
caption = "--"
end create
end create
ActualFreeSpace = sys.DiskFreeSpace("c:\") ' Get disk free space in MB
result = IniFile.open("diskfull.ini",fmOpenRead)
if result = -1 then
riga = IniFile.ReadLine
if instr(riga,"MinimumFreeSpace") then
MinimumFreeSpace = val(mid$(riga,instr(riga,"=")+1,len(riga)-instr(riga,"=")))
end if
IniFile.close
else ' If file does not exist, use default value.
MinimumFreeSpace = DEFAULT_MINIMUM ' MB
end if
ActualFreeLabel.caption = "Free space available: " & str$(int(ActualFreeSpace)) & " MB"
MinimumFreeLabel.caption = "Minimum space required: " & str$(MinimumFreeSpace) & " MB"
SpaceCheck
'MailerForm.showmodal
sub SpaceCheck
MailerForm.show
if ActualFreeSpace<MinimumFreeSpace then
SendMail
ShowMessage("Lack space on disk: notification email has been sent.")
end if
application.terminate
end sub
sub SendMail
CQ.CreateObject("PAINET.MAILMSG")
CQ.AddTo("indirizzo@email")
CQ.SetBody("Corpo del messaggio")
CQ.SetSubject("oggetto del messaggio")
CQ.SetFrom("mittente")
MailResult = CQ.Deliver
end sub
sub SendMail
CQ.CreateObject("PAINET.MAILMSG")
CQ.AddTo("indirizzo@email")
CQ.SetBody("Corpo del messaggio")
CQ.SetSubject("oggetto del messaggio")
CQ.SetFrom("mittente")
MailResult = CQ.Deliver
Torna a Applicazioni Office Windows
Problemi di ricezione Mail su outlook Autore: danibi60 |
Forum: Applicazioni Office Windows Risposte: 2 |
Equiparare il tatso + al tasto invio Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 2 |
disco di emergenza di cui parla WinMagazine Autore: MarioLombardi |
Forum: Sistemi Operativi Windows Risposte: 4 |
Visitano il forum: Nessuno e 99 ospiti