Soyez le premier à donner votre avis sur cette source.
Vue 5 924 fois - Téléchargée 451 fois
Option Explicit Public Requetes As Long Public Visites As Long Public FileView As Long Public LastIp As String Public Begin As Integer Public Fin As Integer Public x As String Private Sub Command1_Click() Dim FileIndex As Integer Dim FileIndex2 As Integer Dim Line As String Dim i As Long Dim FeedBack As VbMsgBoxResult Dim Count As Long On Error GoTo Fin FileIndex = FreeFile CMD.ShowOpen On Error Resume Next i = 0 Open CMD.FileName For Input As FileIndex Line = Input(10, FileIndex) If Line <> "GLogFilev1" Then FeedBack = MsgBox("Le fichier log n'est pas au format Glog, voulez vous le convertire?", vbQuestion + vbYesNo, "Attention") Close FileIndex Open CMD.FileName For Input As FileIndex If FeedBack = vbYes Then FileIndex2 = FreeFile Open CMD.FileName & ".glog" For Binary As FileIndex2 Put #FileIndex2, , "GLogFilev1" & vbCrLf Do While Not EOF(FileIndex) i = i + 100 Line = Input(100, FileIndex) Line = Replace(Line, Chr(10), vbCrLf) Line = Replace(Line, """", "'") Line = Replace(Line, ",", ";") Put #FileIndex2, , Line Label1.Caption = Int((i / (LOF(FileIndex) / 100))) & " % de la convertion" DoEvents Loop Close FileIndex Close FileIndex2 Open CMD.FileName & ".glog" For Binary As FileIndex GoTo Analyse Else Exit Sub End If Else Analyse: i = 0 FileView = 0 Visites = 0 Requetes = 0 Do While Not EOF(FileIndex) Input #FileIndex, Line i = i + Len(Line) If Req.Value = 1 Then Requetes = Requetes + 1 If Vis.Value = 1 Then If AlreadyIP(Line) = False Then Visites = Visites + 1 If Fil.Value = 1 Then If IsValable(Line) = True Then FileView = FileView + 1 Label1.Caption = Int((i / (LOF(FileIndex) / 100))) & " % de l'analyse" DoEvents Loop End If Close FileIndex Close FileIndex2 For i = 1 To IP.ListCount Label1.Caption = "Résolution des IP (" & i & "/" & IP.ListCount & ")" If Check1.Value = 1 Then Line = fGetHostName(IP.List(i)) If Check1.Value = 0 Or Line = "" Then List1.AddItem IP.List(i) Else List1.AddItem Line End If DoEvents Next Label1.Caption = "Terminé" Req.Caption = "Reqûetes " & Requetes Vis.Caption = "Visiteurs (IP unique) " & Visites Fil.Caption = "Vue du fichier " & FileView Exit Sub Fin: End Sub Public Function IsValable(Line) As Boolean Begin = InStr(1, Line, "GET") Fin = InStr(Begin, Line, "HTTP") Line = Mid(Line, Begin + 3, Fin - Begin - 3) If InStr(1, Line, Text2.Text) > 0 Then IsValable = True If Check2.Value = 1 Then If InStr(1, Line, Text1.Text) > 0 Then IsValable = True If InStr(1, Line, Text1.Text) > 0 Then IsValable = False End If Else IsValable = False End If End Function Public Function AlreadyIP(Line) As Boolean Dim IPV As String Dim i As Long On Error Resume Next IPV = Left(Line, InStr(1, Line, " ") - 1) If IPV = LastIp Then AlreadyIP = True LastIp = IPV Exit Function End If For i = 0 To IP.ListCount - 1 If IPV = IP.List(i) Then AlreadyIP = True LastIp = IPV Exit Function End If Next AlreadyIP = False IP.AddItem IPV LastIp = IPV End Function Private Sub List1_DblClick() MsgBox "Résolution de l'IP : " & fGetHostName(List1.List(List1.ListIndex)) End Sub
17 juin 2003 à 09:27
17 juin 2003 à 08:17
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.