Visual C # Resource file programming-use resource files <zt>-Windows development-. NET

Source: Internet
Author: User
In Visual C # Resource file programming-create resource file, we have introduced how to use Visual C # to create resource files. This article will go on to the topic of the previous article to discuss another question about resource files, how to use resource files in Visual C. In the previous article, we have successfully created a resource file named "My. resources. This resource file contains an icon resource named "demo. ico", several Image resources and a string resource, and the name "MyStr" in the file ". We will take the resource file created in the previous article as an object, and take a specific program example to see how to use the resource file with Visual C.
I. Software environment for program design and operation in this article:
(1). Microsoft Windows 2000 Server Edition
(2). Net FrameWork SDK Beta 2
II. Some concepts and theories in programming:
The concept and theory involved in programming are mainly the mutual conversion of two variables. These two variables are called Value Type Variable and Reference Type Variable ). The conversion between the two is called Boxing and Unboxing in Visual C ). The so-called packing is the process of converting a real-value type variable into a reference type variable, and vice versa. So what types of variables are reference type variables and what types of variables are real-value variables? What is the difference between the two? The reference types in Visual C # generally refer to these types, such as Object, Class, Interface, Delegate, String, and Array. The variables defined by these types are reference type variables. The real value type is the common integer, Boolean, and enumeration types. The variables defined by these types are the real value type variables. The biggest difference between them is that reference type variables are pointers to object objects, and real-value type variables are real object objects. Since packing and picking are very conceptual operations, it takes a lot of time to describe in detail. This is beyond the main scope of this article. Therefore, this article only introduces program-related operations. The detailed procedure will be introduced in the next session.
III. Solutions to the important steps of programming:
(1). How to embed resources during program compilation. The resource file and program are two independent files. To embed the resource file into the final generated program, you must add the "/resource" command during compilation, this command can be abbreviated as "/res ". In this article, the program name is "use. cs" and the resource file name is "My. resources". The compilation Command of the resource embedding program is as follows:
Csc.exe/res: My. resources use. cs

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.