[新手]
由於我是硬體走來的
公司現在要我嘗試寫一個 硬碟容量回傳的程式
看別人寫過的範例 修改 部分的參數黨都已經沒有了
嘗試過C python 以及JAVA
但是我都沒有執行成功的
還請各位前輩教導
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each Driver in objFSO.Drives
If Driver.DriveType = 2 then
MailBody=MailBody & "Driver letter:" & Driver.DriveLetter & " Totalsize:" & fix(Driver.Totalsize/2^20) & "MB" &_
" FreeSpace:" & fix(Driver.FreeSpace/2^20) & "MB" & vbCrLf
End If
Next
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "寄件者郵件"
objEmail.To = "收件者郵件"
objEmail.Subject = "郵件主旨"
objEmail.Textbody = MailBody
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP主機位址"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send