ABA


"מישהו יכול לתת דוגמא לתוכנה שמראה כמה מקום פנ"
גירסת הדפסה        
קבוצות דיון פיתוח, תיכנות ובניית אתרים נושא #5438 מנהל    סגן המנהל    מפקח   Winner    צל"ש   מומחה  
אשכול מספר 5438
dfxhgasdfhg

   01:11   20.03.03   
אל הפורום  
  מישהו יכול לתת דוגמא לתוכנה שמראה כמה מקום פנ  
 
   וי יש בכוננים? בויבי


                                שתף        
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

  האשכול     מחבר     תאריך כתיבה     מספר  
  הרי לך דוגמא ב- ASP codmaster 20.03.03 10:11 1
     תודה רבה אבל 2 שאלות. dfxhgasdfhg 20.03.03 12:42 2

       
codmaster

   10:11   20.03.03   
אל הפורום  
  1. הרי לך דוגמא ב- ASP  
בתגובה להודעה מספר 0
 
   האובייקט הוא FileSystemObject , (בלי להשתמש ב- API מיותרים)
תעשה את השינויים הדרושים כדי להגר את הקוד הזה ל-VB (ואין הרבה שינויים)


<%
Set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives
For Each DiskDrive in Drives
If DiskDrive.IsReady Then
totalspace = DiskDrive.TotalSize
freespace = DiskDrive.FreeSpace
usedspace = totalspace - freespace

freepercent = Int((freespace/totalspace)*100)
freemb = Int((freespace/1024)/1024)
usedmb = Int((usedspace/1024)/1024)
usedpercent = Int((usedspace/totalspace)*100)

If freespace =< 1048576 Then
freelabel = FormatNumber(freespace/1024, 1) & " Kb"
Elseif freespace =< 1073741824 then
freelabel = FormatNumber((freespace/1024)/1024, 1) & " Mb"
Else
freelabel = FormatNumber(((freespace/1024)/1024)/1024, 2) & " Gb"
End If

If usedspace =< 1048576 Then
usedlabel = FormatNumber(usedspace/1024, 1) & " Kb"
Elseif usedspace =< 1073741824 Then
usedlabel = FormatNumber((usedspace/1024)/1024, 1) & " Mb"
Else
usedlabel = FormatNumber(((usedspace/1024)/1024)/1024, 2) & " Gb"
End If

If Left(freelabel,3) = "0.0" Then freelabel = "0 bytes"
If Left(usedlabel,3) = "0.0" Then usedlabel = "0 bytes"

used_alt_tag = "<b>Drive " & DiskDrive.DriveLetter & ":</b> " & usedlabel & " in use"
free_alt_tag = "<b>Drive " & DiskDrive.DriveLetter & ": </b>" & freelabel & " free"

Response.Write "Drive " & DiskDrive.DriveLetter & ": "

If DiskDrive.VolumeName <> "" then
Response.Write " : "
End If
Response.Write "Used=" & usedpercent & "% " & used_alt_tag
Response.Write " | Free=" & (100-usedpercent) & "% " & free_alt_tag
Response.Write "<br>"

End If
Next

Set Drives = nothing
Set FileSystemObject = nothing
%>

עדן


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
dfxhgasdfhg

   12:42   20.03.03   
אל הפורום  
  2. תודה רבה אבל 2 שאלות.  
בתגובה להודעה מספר 1
 
   המטרה שלי זה שלא יהיה פורם אלא מתי שילחצו על זה זה ישר ירוץ, איך אני משנה את הקוד שפשוט ישמור את התוצאות לתוך 1.txt בהקלקה עליו?
אני יודע שצריך לעשות את הקוד בתוך FORM_LOAD ולכתוב גם:
FORM1.VISIBLE=FALSE

2. אני מתחיל וסליחה על הבורות אבל מה זה FileSystemObject? איך אני מוסיף אותו?


                                                         (ניהול: מחק תגובה)
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד

תגובה מהירה  למכתב מספר: 
 
___________________________________________________________________

___________________________________________________________________
למנהלים:  נעל | תייק בארכיון | מחק | העבר לפורום אחר | מחק תגובות | עגן אשכול
       



© כל הזכויות שמורות ל-רוטר.נט בע"מ rotter.net