Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. extract URLs of Strings?

extract URLs of Strings?

Scheduled Pinned Locked Moved C#
csharphelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ger_creal
    wrote on last edited by
    #1

    Hello everyone! Iam coding a little tool in C# which could be used as image downloader from websites. Via httpget I retrieve the pagecontent of the entire website and put all that into a textbox objekt (like a console) now I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string. But I have no idea. can you help me? :doh:

    X R 2 Replies Last reply
    0
    • G ger_creal

      Hello everyone! Iam coding a little tool in C# which could be used as image downloader from websites. Via httpget I retrieve the pagecontent of the entire website and put all that into a textbox objekt (like a console) now I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string. But I have no idea. can you help me? :doh:

      X Offline
      X Offline
      Xodiak
      wrote on last edited by
      #2

      regular expressions perhaps? you can do pattern matching to get the urls and such. im sure that there is a class out there that will download the actual source of a given webpage, you can then parse that source string to retrieve the href to jpg files. keep in mind that a lot of people are ussing CSS and there might not be any direct links in the source document, you might have to go to the CSS files to find jpg urls...hope thats what you were looking for.

      G 1 Reply Last reply
      0
      • G ger_creal

        Hello everyone! Iam coding a little tool in C# which could be used as image downloader from websites. Via httpget I retrieve the pagecontent of the entire website and put all that into a textbox objekt (like a console) now I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string. But I have no idea. can you help me? :doh:

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        ger_creal wrote:

        I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string

        Stay tuned for an article (that I'll be uploading very shortly) that will let you do this with ease! /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        G 1 Reply Last reply
        0
        • R Ravi Bhavnani

          ger_creal wrote:

          I want to extract any "http:\\xxxxxxxxxxxxxxxxx.jpg" links and put them into a new string

          Stay tuned for an article (that I'll be uploading very shortly) that will let you do this with ease! /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          G Offline
          G Offline
          ger_creal
          wrote on last edited by
          #4

          Ok...sounds great. thx.

          1 Reply Last reply
          0
          • X Xodiak

            regular expressions perhaps? you can do pattern matching to get the urls and such. im sure that there is a class out there that will download the actual source of a given webpage, you can then parse that source string to retrieve the href to jpg files. keep in mind that a lot of people are ussing CSS and there might not be any direct links in the source document, you might have to go to the CSS files to find jpg urls...hope thats what you were looking for.

            G Offline
            G Offline
            ger_creal
            wrote on last edited by
            #5

            Yes thats true. but css is not the problem. the problem is javascript. to download images in javascript links i have to find out the name of the image file (eg: xxxxx.jpg) and then i have to build up a new string containing filename and url. steps ----- 1. find out jpg filenames 2. build a new string containing filenames and url 3. filter big images (to avoid thumb downloading) 4. perhaps modify filenames (eg: xxxxxxx_thumb.jpg ----> xxxxxx.jpg) 5. download stuff

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups