• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to Register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

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

Collapse

Unconfigured Ad Widget

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, 06:00 AM.
Working...
X

Sign up for a News Letter Click here to sign up