Announcement

Collapse
No announcement yet.

How To Change Absolute Path into Relative Path Using ASP.Net?

Collapse

Ads on showthread pages

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How To Change Absolute Path into Relative Path Using ASP.Net?

    WordPress Hosting on SSD Servers
    One can use below mentioned asp.net code to change absolute path into relative path:

    Dim Domname,link,str,temp as string

    Domname = "http://Domain.com"
    ObjDoc = Server.CreateObject ("MSXML2.DOMDocument.4.0")
    objDoc.Async = False
    ObjHTTP = Server.CreateObject ("XStandard.HTTP")
    objHTTP.AddRequestHeader ("User-Agent", "Mozilla/4.0 (compatible; MyApp 1.0; Windows NT 5.1)")
    objHTTP.Get ("http://Domain.com")
    str = ""

    If objDoc.LoadXML (objHTTP.ResponseAsXML) Then
    For Each objNode In objDoc.SelectNodes ("//a[string (@src)!= ]")
    link = objNode.Attributes.GetNamedItem ("href").Text
    temp = link

    If InStr (link, "..") > 0 Then
    link = Mid (link, InStr(img, "/") + 1)
    End If
    Path = domname & "/"
    Path += link
    objHTTP.Get (Path
    Next
    End if

    This code will change all the absolute path of a tag into the relative path of the site Domain.Com.
    Last edited by admin; 08-21-2015, 05:00 AM.
Working...
X
Sign up for a News Letter Click here to sign up