Solved

Vb code not finding function

Posted on 2013-01-17
2
355 Views
Last Modified: 2013-01-17
I'm  not sure what function this code is attempting to use.  This is re-writing old code to work with current versions of .net  currently the function Request() is flagged as undeclared. I'm not sure the original intent of this function or where to find it.

Partial Public Class _loginlookup
 

    

function stripQuotes(strWords) 
	stripQuotes = replace(strWords, "'", "''") 
end function 

function killChars(strWords) 
	dim badChars(0 to 6) as string
	dim newChars as string
	dim i 


	badChars(0) = "select"
    badChars(1) = "drop"
    badChars(2) = ";"
    badChars(3) = "--"
    badChars(4) = "insert"
    badChars(5) = "delete"
    badChars(6) = "xp_"
	newChars = strWords 
	
	for i = 0 to uBound(badChars)
		newChars = replace(newChars, badChars(i), "")
	next 
	killChars = newChars 
end function 

function HTMLEncoder(strWords) as string
	
    HTMLEncoder = System.Web.HttpContext.Current.Server.HTMLEncode(strWords)
end function

'Used to secure request objects (Strings ONLY)
function allSecure(fieldName)
	allSecure = stripQuotes(killChars(HTMLEncoder(Request(fieldName))))
end function

'Used to secure variables
function allSecure2(fieldName)
	allSecure2 = stripQuotes(killChars(HTMLEncoder(fieldName)))
end function

end class

Open in new window

0
Comment
Question by:UnderSeven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38788439
It looks like accessing the Request query parameter i.e. the current Request.
Try

System.Web.HttpContext.Current.Request(fieldName)

Open in new window

0
 

Author Closing Comment

by:UnderSeven
ID: 38788462
Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question