Home Backend Development C#.Net Tutorial Detailed introduction to mixed development and testing of C# and VB.net (pictures and text)

Detailed introduction to mixed development and testing of C# and VB.net (pictures and text)

Mar 15, 2017 am 11:09 AM


In the past, programming software was basically developed using a development language, either C#, Java, or Delphi. Recently, I have seen some development methods of merging multiple C# projects into one solution, and I think this method is good. Below we will create a simple example to experience the charm of Microsoft platform multi-language development.

Development process:

1. Create a new C# Windows program project

2. Create a new VBclass library project

Add the class library to the C# project just now ("Add Solution")

After building the project, the following picture is shown:

3. Write VB class library code

Create a new test method SayHello() and simply output information prompts.

4. Add project Reference

Add project reference in C# project, that is, VB project.

5. Design forms and write C# formsEventCode

# #

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

using System;

using System.Windows.Forms;

 

using ClassLibrary1;

 

namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            new Class1().SayHello();       

        }

    }

}

Copy after login

6. Test results

##Multi-project mixed development mainly has the following benefits:

Layered design, each Layers can be developed independently to facilitate division of labor;

Just add references between different projects. After compilation, it will be a

Dl

l file. When publishing, you can decide whether to publish Dll or source code according to your needs;

Modular development

facilitates the formation of code assets. In the future, similar projects only need to reference related projects to avoid citing redundant code; There is another point that other language platforms cannot reach now. What is achieved is that the advantages of different languages ​​​​under the .net platform can be used, and programmers using different languages ​​​​can jointly develop a project.

The above is the detailed content of Detailed introduction to mixed development and testing of C# and VB.net (pictures and text). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Active Directory with C# Active Directory with C# Sep 03, 2024 pm 03:33 PM

Active Directory with C#

Access Modifiers in C# Access Modifiers in C# Sep 03, 2024 pm 03:24 PM

Access Modifiers in C#

Random Number Generator in C# Random Number Generator in C# Sep 03, 2024 pm 03:34 PM

Random Number Generator in C#

C# Data Grid View C# Data Grid View Sep 03, 2024 pm 03:32 PM

C# Data Grid View

C# StringReader C# StringReader Sep 03, 2024 pm 03:23 PM

C# StringReader

Patterns in C# Patterns in C# Sep 03, 2024 pm 03:33 PM

Patterns in C#

C# StringWriter C# StringWriter Sep 03, 2024 pm 03:23 PM

C# StringWriter

BinaryWriter in C# BinaryWriter in C# Sep 03, 2024 pm 03:22 PM

BinaryWriter in C#

See all articles