. Net programmers-snippet Compiler

Source: Internet
Author: User
Snippet Compiler

Snippet compiler is based on windows? You can use it to compile, compile, and run code. This tool is useful if you have a small code segment and you do not want to create a complete Visual Studio. NET project (and all files that accompany the project) for it.

Note: Visual Basic versions earlier than 6.0 can run and debug without saving project files, which is very convenient. This feature is useful when writing a small program temporarily. After Visual Studio. NET, you have to create and save many files like Visual C ++, even for a very small project. However, it is said that this feature will be restored after Visual Studio 2005 Express, which sounds great.

For example, suppose I want to explain how to use Microsoft ?. . NET Framework to start another application. In snippet compiler, I will start by creating a file that can create a small console application. You can create code snippets in the main method of the console application, which is exactly what I want to do here. The following code snippet demonstrates how to create a notepad instance from the. NET Framework:

Using system;
Using system. collections;

Public class myclass
{
Public static void main ()
{
System. Diagnostics. Process proc = new system. Diagnostics. Process ();
Proc. startinfo. filename = "notepad.exe ";
Proc. Start ();
Proc. waitforexit ();
}
}

Of course, the code snippet itself cannot be compiled, and this is exactly where snippet compiler is used. Figure 1 shows the sample code in snippet compiler.

Figure1Snippet Compiler

To test the code snippet, you only need to press the play (run) button (green triangle) and it will run in debug mode. This code snippet generates a pop-up console application and displays notepad. When you close notepad, the console application is also closed.

Personally, when I try to create a small example for someone who asks for help, I find that snippet compiler is so valuable-if you do not use this tool, I usually have to create a new project to make sure that each part can be compiled, then send the code snippet to the helper, and delete the project. Snippet compiler makes the process easier and more enjoyable.

Snippet compiler is written by Jeff key and can be downloaded from the http://www.sliver.com/dotnet/SnippetCompiler.

Go to the. NET programmer's ten essential tools-directory

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.