vb.net control, Web service brief

Source: Internet
Author: User
web| Control

The following options are available when you create a new vb.net project:

Class Library: A group of class libraries that have no GUI, similar to Java beans. Some common modules are written to the class library, which is a good way to use in your project.
It can be used in Windows apps or Web apps or in more projects.
Only the DLL that corresponds to the class library must be included in the reference, that is, by reference to the name, the class name. If there are namespace in the class library
Begin to imports this namespace first. You can also use only the class name when calling.

Windows Control Library: A control that is built for the window app with a GUI.
When used, select Add or remove items in the user control bar on the left toolbar. Select the DLL for the control. The control is added to the panel and can be loaded into the form like a normal control.
When I use it, I also add the corresponding DLL in the reference. Because even if you do the first step, you can only add controls to the
When you define a control class, you cannot find the corresponding class.

Web Control Library: No tests, I think it's a GUI control that can be used in web apps. You should use a method similar to the Windows control

asp.net Web service: When you build a Web server, you create a virtual directory in IIS, just like the Web App. When the service is established, the reference is to the newly established web directory (http://localhost ...). method to refer to.
The Web service file is a file that ends with. asmx, and the code file is in. Asmx.vb. It also operates like a class library, where the code is written in a class. Just the method to publish as a Web service is preceded by <webmethod () > _ as follows:
<webmethod () > _
Public Function HelloWorld () as String
Return to "Hello World"
End Function
When you browse http://localhost/WebService1/Service1.asmx, the list displays the published service. And there are more detailed operational explanations.
Use the following methods
Create a web App or window app. Add a Web reference to the reference. This will allow you to select a URL for the Web service
Add the corresponding Web URL as Http://localhost/WebService1/Service1.asmx
In your code, you can refer to WebService as a reference name, a class name. If the reference name is localhost WebService class is Service1
The reference method is
Dim AA as localhost. Service1
AA = New localhost. Service1

Dotnet is really easy to start with compared to Java.



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.