You are currently browsing the archives for the Uncategorized category.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Apr | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
21. August 2011 by admin.
‘ ********************************************************************
‘ Paste this block of code on your web page where you would like text
‘ links to be displayed. This code will dynamically add and remove text
‘ links on your web page according to your BackLinks.com settings.
‘ ********************************************************************
‘ The following variable defines whether links are opened in a new window
‘ (1 = Yes, 0 = No)
Const OpenInNewWindow As Byte = 1
‘ This variable defines the timeout for the script, in seconds
Const TimeOut As Byte = 30
Const UserKey As String = “DO96-Q8HH-4BC5″
Public Function GetBackLinksData() As String
Dim TextEncoding As System.Text.Encoding
Dim Reader As System.IO.StreamReader
Dim Writer As System.IO.StreamWriter
Dim WebResponce As Net.WebResponse
Dim IOReceive As System.IO.Stream
Dim WebRequest As Net.WebRequest
Dim strPostingString As String
Dim LinkUrl As String
Dim BLURL As String
If Request.ServerVariables(”HTTPS”).ToString() = “on” Then
LinkUrl=”https://”
Else
LinkUrl=”http://”
End If
‘LinkUrl = LinkUrl & Request.ServerVariables(”HTTP_HOST”).ToString() & Request.ServerVariables(”REQUEST_URI”).ToString()
LinkUrl = LinkUrl & Request.ServerVariables(”HTTP_HOST”).ToString() & Request.ServerVariables(”SCRIPT_NAME”).ToString()
If Request.ServerVariables(”QUERY_STRING”).ToString() <> “” Then
LinkUrl = LinkUrl & “?” & Request.ServerVariables(”QUERY_STRING”).ToString()
End If
LinkUrl = server.URLencode(LinkUrl)
strPostingString = “&Key=” & UserKey
strPostingString = strPostingString & “&LinkUrl=” & LinkUrl
strPostingString = strPostingString & “&OpenInNewWindow=” & OpenInNewWindow
BLURL = “http://www.backlinks.com/engine.php?” & strPostingString
Try
WebRequest = Net.WebRequest.Create(BLURL)
WebRequest.Method = “GET”
WebRequest.Timeout = TimeOut * 1000
WebResponce = WebRequest.GetResponse
IOReceive = WebResponce.GetResponseStream
TextEncoding = System.Text.Encoding.GetEncoding(”utf-8″)
Reader = New System.IO.StreamReader(IOReceive, TextEncoding)
GetBackLinksData = Reader.ReadToEnd()
If Not WebResponce Is Nothing Then
WebResponce.Close()
End If
Catch exError As Exception
Return exError.Message
End Try
End Function
Public Sub Page_Load(sender As Object, e as System.EventArgs)
Dim OutString As String
OutString = GetBackLinksData()
BackLinks.Text = OutString
End Sub
Posted in Uncategorized | No Comments »