Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Shorten link but still clickable in richtextbox

$
0
0
Hello every one, i have been racking my brain trying to get this to work for days now but still cant find an answer.

I am scraping my web page for links which are directly linked to files , i can get all the links to list into a richtextbox, but i would like only the file name to show and not the path but still remain clickable to the original link, any help would be very much appreciated

heres my code so far


 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        WebBrowser1.Navigate("http://www.blahblahblah.blah")

    End Sub

    Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Dim PageElements As HtmlElementCollection = WebBrowser1.document.GetElementsByTagName("a")
        RichTextBox1.DetectUrls = True
        For Each CurElement As HtmlElement In PageElements
            RichTextBox1.Text = RichTextBox1.Text.Replace("@", " ") & CurElement.GetAttribute("href") & Environment.NewLine



        Next
    End Sub






Thanks in advance

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>