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. Web Development
  3. ASP.NET
  4. problem in getting html source code in asp.net

problem in getting html source code in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-netdebugginghelp
1 Posts 1 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.
  • H Offline
    H Offline
    hi_arv
    wrote on last edited by
    #1

    Hi to all, i had use this code for got html source of any page for downloading purpuse, but now i have faces a problem when i run my application then some time this function don't return html source. In my application i am using a loop for getting html source code for 10 page so i write a while loop and call this function GetHtmlSource for html source now when i debug it then seen that randamly leave one or two page which is not getting html source code if i run two times then it leave diffrent page on both time not same page so i don't understand why this could happen, where as i send right url all time within loop. if any body have any clue plz send ASAP. i need it urgent plz. Public Function GetHtmlSource(ByVal url As String) As String Dim objWebClient As New System.Net.WebClient Dim aRequestedHTML() As Byte Dim strRequestedHTML As String Try objWebClient.BaseAddress = System.String.Empty aRequestedHTML = objWebClient.DownloadData(url) Dim objUTF8 As New UTF8Encoding strRequestedHTML = objUTF8.GetString(aRequestedHTML) Return strRequestedHTML Catch ex As Exception strRequestedHTML = ex.Message End Try End Function thanks in advance arvind

    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