|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Verifica a extistência de URLS dentro de arquivos
|
|
|
|
Postada em 21/10/2004 por Josefh Hennyere
Function ScanForURL(filename As String, list As ListBox) Static thewww, thecom, thenet, theorg thewww = 1: thecom = 1: thenet = 1: theorg = 1 Dim free free = FreeFile list.Clear Open filename$ For Binary Access Read As #free Dim fileL, i fileL = LOF(free) Dim Text$ For i = 1 To fileL Step 32000 Text$ = Space(32000) Get #free, i, Text$ thewww = InStr(1, LCase(Text$), LCase("www."), 1) thecom = InStr(1, LCase(Text$), LCase(".com")) thenet = InStr(1, LCase(Text$), LCase(".net")) theorg = InStr(1, LCase(Text$), LCase(".org")) If thewww <> 0 And thecom <> 0 Then list.AddItem Mid(Text$, thewww, thecom + 3) GoTo again End If If thewww <> 0 And thenet <> 0 Then list.AddItem Mid(Text$, thewww, thenet + 3) GoTo again End If If thewww <> 0 And theorg <> 0 Then list.AddItem Mid(Text$, thewww, theorg + 3) GoTo again End If again: Next i Close #free End Function
'Para chamar: 'Você so vai precisar de um botão de comando e uma list box
Private Sub Command1_Click() ScanForURL "C:arquivo.txt", List1 End Sub
|
|
|
|
|