Skills for converting ASP programs into components in VB

Source: Internet
Author: User

In the "VB and Basic" section of Netease's virtual community, there is an article "using VB to write a pure ASP program [transfer] [Technology]". In fact, I think the best way is to do this --

The definition in the original article is as follows:
Dim m_objResponse As Response
Actually, we wrote about it. dll is not very good, that is, if you want to get the program. when debugging asp programs, especially those that have passed the debugging. asp program. dll ,. asp programs use standard component names. The default component name is response, request, and so on. If m_obj is added before the quote, the corresponding change is also required if this sentence is used in the program, this will bring about a lot of work, and second, there is no improvement in the readability of the program.

Therefore, the best way is to define the following:

Dim Context As ObjectContext
Dim Server As Server
Dim Request As Request
Dim Session As Session
Dim Response As Response
Of course, there will be
Private Sub Class_Initialize ()
Set Context = GetObjectContext ()
Set Server = Context ("Server ")
Set Request = Context ("Request ")
Set Response = Context ("Response ")
Set Session = Context ("Session ")
End Sub
.

It has been proven to be completely feasible.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.