Use. Net to Develop ASP Components

Source: Internet
Author: User
Currently, a website using ASP requires a lot of image processing. all third-party components cannot meet my requirements. net. therefore, you need to write components by yourself. I chose VB, but I found some information online. they are not complete, or they are too complicated to understand, so they finally chose. net. (mad at C ++ ...)
This is actually not practical, because Asp.net can be used in a. NET environment.

1. Open vs. net. To create a project, select the class library as the template. Here I use C #

2. Change the automatically generated class1.cs to test. CS and modify the corresponding code. Here we will just perform a test first.

3. Write a simple function and return a string.
The Code is as follows:
Using system;

Namespace allinhands
{
/// <Summary>
/// Summary of class1.
/// </Summary>
Public class test
{

Public String getteststring ()
{
Return "this is my test string .";
}
}
}

4. An important step.
Open project properties, and change "register for com InterOP" to "true" in "configuration properties"-> "generate"

5. Generate a project.

Create an ASP file.
<%
Set QQ = server. Createobject ("allinhands. test ")
Response. Write QQ. getteststring ()
Set QQ = nothing
%>

"Allinhands" is your project name, and test is the class name.
Open and output "this is my test string ."

On this basis, we can make other complex components, as long as you want

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.