Skip to content

Instantly share code, notes, and snippets.

View AddAHeader.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim lcHeader As String = ""
If Not Request.Headers("X-MyHeader") Is Nothing Then
lcHeader = Request.Headers("X-MyHeader").ToString()
Response.Write("Hey, thanks for sending X-MyHeader: " & lcHeader)
Else
View ChangeUserAgent.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim lcUserAgent As String = Request.UserAgent.ToString()
If lcUserAgent.Contains("Visual Search Pro Demo") = False Then
Response.Write("Sorry. Not the User-Agent I expected.")
Else
View FifthDemo.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim lcHeader As String = ""
If Not Request.Headers("X-MyHeader") Is Nothing Then
lcHeader = Request.Headers("X-MyHeader").ToString()
Response.Write("Hey, thanks for sending X-MyHeader: " & lcHeader)
Else
View FourthDemo.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim lcUserAgent As String = Request.UserAgent.ToString()
If lcUserAgent.Contains("Visual Search Pro Demo") = False Then
Response.Write("Sorry. Not the User-Agent I expected.")
Else
Response.Write("Yay! You selected the correct User-Agent!")
View THIRDDEMO.DLL (thirddemo.prg)
** This DLL is a simple PRG file.
** It will create a web page "on the fly"
** and return it as a string to the
** calling program.
DEFINE CLASS Demo AS SESSION OLEPUBLIC
FUNCTION GetHTML(tcUA AS STRING, tcIP AS STRING) AS STRING
LOCAL lcString AS STRING
TEXT TO m.lcString TEXTMERGE NOSHOW
<!DOCTYPE html>
View ThirdDemo.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim lcUserAgent As String = Request.UserAgent.ToString()
Dim lcIPAddress As String = Request.UserHostAddress.ToString()
If lcUserAgent.Contains("Trident") = True Then
Response.Write("Sorry, we don't allow Internet Explorer!<br /><br />" & lcUserAgent)
Return
View Demos - Default.aspx
<%@ Page Language="VB" %>
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
View SECONDDEMO.DLL (seconddemo.prg)
** This DLL is a simple PRG file.
** It will create a web page "on the fly"
** and return it as a string to the
** calling program.
DEFINE CLASS Demo As Session OLEPUBLIC
FUNCTION GetHTML(tcUA As String, tcIP As String) As String
LOCAL lcString As String
TEXT TO m.lcString TEXTMERGE NOSHOW
<!DOCTYPE html>
View SecondDemo.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim lcUserAgent As String = Request.UserAgent.ToString()
Dim lcIPAddress As String = Request.UserHostAddress.ToString()
Dim oVFP As New Interop.SecondDemo.Demo
Dim cRet As String = oVFP.GetHTML(lcUserAgent,lcIPAddress)
oVFP = Nothing
View FirstDemo.aspx
<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs)
Dim oVFP As New Interop.FirstDemo.Demo
Dim cRet As String = oVFP.GetHTML()
oVFP = Nothing
Response.Write(cRet)
End Sub
</script>