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
C

cyus

@cyus
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • function for urlcheck
    C cyus

    Hi javier, this is the scenario i have a database which has 2000 records in that one field is url will i have to check whether the given url is having valid connection r broken connection for that iam using a function which is the following... the code snippet Public Function checkurl(ByVal url As String) As String Dim req As System.Net.HttpWebRequest Dim res As System.Net.HttpWebResponse Dim r As System.IO.StreamReader Dim ex As Exception 'error exeption holder Dim pge As String 'page holder 'set up error trapping Dim strerr As String = "" Try 'display request url req = req.Create(url) 'set the user agent 'some site might brush you off if it is not set 'to stop bots and scrapers req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)" 'get page res = req.GetResponse() r = New System.IO.StreamReader(res.GetResponseStream()) pge = r.ReadToEnd r.Close() res.Close() 'display respondent url Dim struri As String = res.ResponseUri.AbsoluteUri 'extract and display meta refresh tag, if it exists Dim strpge As String = System.Text.RegularExpressions.Regex.Match(pge, "URL=(?[^""]+)""").Groups("href").Value() 'extract and display page title Dim strtit As String = System.Text.RegularExpressions.Regex.Match(pge, "(?<title>[^<]+)", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Groups("title").Value Dim SHhash As New System.Security.Cryptography.SHA1Managed 'convert the page to a byte array Dim pgeb As Byte() = System.Text.Encoding.ASCII.GetBytes(pge) 'get the hash as a byte array Dim hashvalue As Byte() = SHhash.ComputeHash(pgeb) 'display the hash as a string strerr = "" Catch ex 'display any error message strerr = ex.Message End Try End Function Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then SqlDataAdapter1.Fill(DsResult) 'DataGrid1.DataBind() If DsResult.Tables(0).Rows.Count > 0 Then For I As Integer = 0 To DsResult.Tables(0).Rows.Coun

    ASP.NET database tutorial

  • function for urlcheck
    C cyus

    hi there, can any one tell me how to write a function to check the validate url in database Thanks in advance cyus

    ASP.NET database tutorial
  • Login

  • Don't have an account? Register

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