Public Function get_New_Folder_Names(directory As DirectoryInfo) As List(Of String) Dim new_Names As New List(Of String) Dim SearchAddress As String = "http://www.imdb.com/find?q=" Dim endOfAddress As String = "&s=all" Dim url As String = "about:blank" url = SearchAddress Dim words() As String words = directory.Name.Split(" ") If words.Count <= 1 Then words = directory.Name.Split(".") For Each word As String In words '( = %28 ') = %29 If word.Contains("(") Then Dim fixword As String = Nothing For letter As Integer = 0 To word.Count - 1 If word(letter) = "(" Then fixword &= "%28" Else fixword &= word(letter) End If Next word = fixword End If If word.Contains(")") Then Dim fixword As String = Nothing For letter As Integer = 0 To word.Count - 1 If word(letter) = ")" Then fixword &= "%29" Else fixword &= word(letter) End If Next word = fixword End If url &= word & "+" Next If url(url.Length - 1) = "+" Then url = url.Remove(url.Length - 1) url &= endOfAddress Navigate(url) new_Names.Add("Fix This!") Return new_Names End Function Private Sub Navigate(ByVal address As String) If String.IsNullOrEmpty(address) Then Return If address.Equals("about:blank") Then Return If Not address.StartsWith("http://") And _ Not address.StartsWith("https://") Then address = "http://" & address End If ' AscW("a") ' AscW("z") Try ' Get HTML data Dim client As New WebClient() Dim data As Stream = client.OpenRead(address) Dim reader As StreamReader = New StreamReader(data) Dim str As String = "" str = reader.ReadToEnd Dim wb As New WebBrowser wb.DocumentText = str Dim doc As HtmlDocument = wb.Document Dim htmlelmcoll As HtmlElementCollection = doc.GetElementsByTagName("") Catch ex As System.UriFormatException Return End Try End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)