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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide ASP code 1

Status
Not open for further replies.

kkarnez

IS-IT--Management
Mar 1, 2001
19
GR
Hello,
is there a way to hide the code in the case of asp?

(the web server runs locally)

thanks
 
You can't view ASP code when trying to access it thru view/source on the browser. You can only see results. QUOTE OF THE DAY
Not to know if bad; not to wish to know is worse.
<%
Jr Clown
%>
 
Like JrClown says -

ASP code runs on the server, so there's no need to hide it (unless your users have access to the server, and then you've got bigger problems). The only thing the users can see is what you send them. So they can see the HTML elements output by your ASP, and they can see any javascript, etc. that you send. But that's all. They'll never see your database connect string, or any of the code that accesses your database.

Chip H.
 
There is really no way to hide asp code if it is running on a local machine. I am assuming you can not restrict access to certain directories. If you are able to, use the security feature built into WinNT to restrict read access thus hiding the asp code.

Another option is to write most, if not all, of your code in DLLs. With VB6.0 you can move almost all of your code into an ActiveX DLL and hide your code. This technique is often used for applications that are sold to end users.
 
Thanks GabeC,
do you know where can I find information on this?
 
Or use VB Webclasses, then your code is compiled to a dll... hard to read...

Jordi Reineman
 
You have two approaches to take here. One, you can just simply write VB ActiveX DLLs like you would for any other application and call it from your ASP page. Two, you can set a reference to the Microsoft Active Server Pages Object Library (ASP.DLL) component in your VB project. By doing this you can use the five ASP objects (Response, Request, Application, Server, Session) directly from your COM DLL.

“Programming Components with Microsoft Visual Basic 6.0 Second Edition” from the Microsoft Press has a small section that describes the this technique. It by no means is this an in-depth discussion on the subject but it provides enough information to get you started. Look in: Part III Using Database and Web Technologies -- Chapter 12 Internet Information Server -- Page 368 Microsoft Active Server Pages Object Library.

Here is a brief description from Microsoft’s web site. (This method slightly differs form the book mentioned above).

This is a short tutorial (closely follows the example in the MS Components book)
When I clicked the source code link at the bottom of the page, a new window opened that was not resizable so I had to view the source of the page to get the full example.

Hope this helps.
 
When I tried to compile, I get a syntax error on this line of the help() sub:
Server.CreateObject(&quot;&quot;ASCExample.FileIO&quot;&quot;)</dir>&quot; & vbCrLf

Any Ideas?
 
I copied and pasted the code into my VB6.0 DLL class and was able to compile successfully.

I think you are probably having a problem with pasting the code into VB. When I pasted the code, the Help sub wrapped some of the text incorrectly.

Make sure every objResponse.write in the Help sub is on its own line and does not wrap to a new line. There are 11 objResponse.write statements in this sub therefore there should only be 11 lines of code in the Help sub.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top