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
%>
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.
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.
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).
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.
When I tried to compile, I get a syntax error on this line of the help() sub:
Server.CreateObject(""ASCExample.FileIO""</dir>" & vbCrLf
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.