Results 1 to 5 of 5

Thread: [RESOLVED] lol ***

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    294

    Resolved [RESOLVED] lol ***



    Umm, yeah... no idea why its writing the text on the form like that.

    Here is the timer that must be doing it
    VB Code:
    1. Private Sub TCalcBandwidth_Timer()
    2.     Dim InOctets As Long
    3.     Dim OutOctets As Long
    4.     Dim i As Integer
    5.     Dim Binary As String
    6.     Dim BinarySplit() As String
    7.     Dim BinarySplitSplit() As String
    8.    
    9.     GetNetStats InOctets, OutOctets
    10.    
    11.     If Received <> 0 And Sent <> 0 Then
    12.         LDownload.Caption = Replace(Settings.Load("TDownloadFormat"), "%u", InOctets - Received)
    13.         LUpload.Caption = Replace(Settings.Load("TUploadFormat"), "%u", OutOctets - Sent)
    14.        
    15.         If Len(Dir(App.Path & "\db\", vbDirectory)) = 0 Then
    16.             MkDir App.Path & "\db\"
    17.         End If
    18.  
    19.         i = FreeFile
    20.         Open App.Path & "\db\Current" For Output As i
    21.             Print i, (InOctets - Received) & Chr(2) & (OutOctets - Sent)
    22.         Close i
    23.  
    24.         If HistoryCount = UBound(History) Then
    25.             For i = 1 To UBound(History)
    26.                 History(i - 1) = History(i)
    27.             Next
    28.         Else
    29.             HistoryCount = HistoryCount + 1
    30.         End If
    31.         History(HistoryCount) = (InOctets - Received) & Chr(2) & (OutOctets - Sent)
    32.         i = FreeFile
    33.         Open App.Path & "\db\History" For Output As i
    34.             Print i, Join(History, Chr(1))
    35.         Close i
    36.  
    37.         If Len(Dir(App.Path & "\db\" & Year(Date), vbDirectory)) = 0 Then
    38.             MkDir App.Path & "\db\" & Year(Date)
    39.         End If
    40.         Binary = ReadFile(App.Path & "\db\" & Year(Date) & "\" & StringMonth)
    41.         If InStr(Binary, Day(Date)) = 0 Then
    42.             Binary = IIf(Len(Binary) > 0, Binary & Chr(1), "") & Day(Date) & Chr(2) & (InOctets - Received) & Chr(2) & (OutOctets - Sent)
    43.         Else
    44.             BinarySplit = Split(Binary, Chr(1))
    45.             For i = 0 To UBound(BinarySplit)
    46.                 BinarySplitSplit = Split(BinarySplit(i), Chr(2))
    47.                 If BinarySplitSplit(0) = Day(Date) Then
    48.                     BinarySplitSplit(1) = Int(BinarySplitSplit(1)) + (InOctets - Received)
    49.                     BinarySplitSplit(2) = Int(BinarySplitSplit(2)) + (OutOctets - Sent)
    50.                     BinarySplit(i) = Join(BinarySplitSplit, Chr(2))
    51.                 End If
    52.             Next
    53.             Binary = Join(BinarySplit, Chr(1))
    54.         End If
    55.         i = FreeFile
    56.         Open App.Path & "\db\" & Year(Date) & "\" & StringMonth For Binary As i
    57.             Put i, , Binary
    58.         Close i
    59.     End If
    60.    
    61.     Received = InOctets
    62.     Sent = OutOctets
    63. End Sub
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width