Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute equivalent

Status
Not open for further replies.

GaryC123

Programmer
Sep 10, 2002
1,041
NO
Is there a command I can use in a dll thats the equivalent of ASP's Execute command i.e.
execute("response.write "hello"))

Using execute in vb causes an error, or is the syntax different?

 
i think u have a response object in VB itself...

Known is handfull, Unknown is worldfull
 
Maybe I should've explained better I want to execute dynamic asp, say for example I pull a code snippet from a db, I then want to be able to execute it as asp, in plain old asp you would just use execute but how to do this in a dll.

 
i dont think that can be done as VB's execute command will execute only VB commands, why not execute them in ASP itself???

Known is handfull, Unknown is worldfull
 
Because I'm trying to build a dll that can be used as a generic way of protecting asp code. i.e. encrypt the code call the dll, it decrypts it and processes it. I have it working but currently have to create a new file with the asp code then server.execute it and then delete the file, which is grand and the file exists for a fraction of a second, even if you watch the folder you will never see it being created - so its fairly safe, but I think it would be better to actually process the asp within the dll itself.

 
i dont think thats possible...

even then why not have a generic ASP page???

Known is handfull, Unknown is worldfull
 
what you could do along those lines, althought it would be a performance draw ( execute statements would be anyhow )..

is use your dll file to :
access the db..
use FSO to write a session based temp file
use fso in page to call this temp file
for each line execute the pulled code
use fso to delete the temp file
clean up


[thumbsup2]DreX
aKa - Robert
 
well writing a component is hunky dory, but they dont tend to like doing direct output... to do that is extremely involved, to the point i gave up on it a long time ago.

one OTHER option that would work, is make your object call populate and RETURN an Array, then cycle the array and execute each placeholder value, if the array is empty, just skip it.

then there's no temp files, it's all self contained, although , you will still need code in page, but it will be to a minimum like :

set blah = createobject("mycom.fetchasp")
set myarr = blah.pullvalues(SQL) ' or whatever
for each item in myarr
execute(item)
next
set myarr = nothing
set blah = nothing


[thumbsup2]DreX
aKa - Robert
 
EH?

you worried about network users figuring out your code?

heck even with the DLL you're going to be calling the DLL, they could use that to figure out the code.

i guess you could use the same logic as above, return a single posistion array with the page content in it ... then it would be :

set blah = createobject("mycom.fetchasp")
response.write blah.pullvalues(SQL) ' or whatever
set blah = nothing

[thumbsup2]DreX
aKa - Robert
 
then you dont need to response write from IN the dll, you're just string concactenating the output, then just dump the output


[thumbsup2]DreX
aKa - Robert
 
I am decrypting ASP code within the dll that I then need to process and throw back to the page. If I am sending asp code back to the page unprocessed then it negates encrypting the asp pages in the first place.

 
you missed what i said, handle EVERYTHING in the dll, and return the OUTPUT not the asp code, the HTML OUTPUT.
then just response.write out the dll call

example .. in dll
function hello()
hello = "hello"
end function

----------------
in asp:
set mydll = createobject("mydll.whatever")
response.write mydll.hello
set mydll = nothing

cant see HOW hello in the output page came to be, it's just there

so ... in turn :
example .. in dll
function hello(ARGS)
hello = Execute(decrypt(dbcall(sql & ARGS)))
' you JUST cant response.write in the code, the DB code will NEED to be VB code NOT VBS
end function

----------------
in asp:
set mydll = createobject("mydll.whatever")
response.write mydll.hello(ARGS)
set mydll = nothing

and voila, html output, all someone knows it's from a DLL that is IF they can get the sourcecode from your ASP page to beginwith... then again if they have access to your ASP sourcecode, they PROBABLY can get the DLL file, and or access to your DB

[thumbsup2]DreX
aKa - Robert
 
you denoted it wouldn't work with response.write, it will work in a dll, in a sub or a function, as most code in a dll is housed inside of one or the other. might require some rewriting of the code in the DB, and in the DLL, but to do something of this magnitude you will have to rewrite some code.

[thumbsup2]DreX
aKa - Robert
 
AND in the rewriting of code, jsut so you know, the easiest form of it would be replacing response.write with output(0) = output(0) & restofline

[thumbsup2]DreX
aKa - Robert
 
one more thing, not many ISPs allow custom dlls on their site...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top