logo search
CSharp_Prog_Guide

Доступ к ресурсам во время выполнения

Чтобы получить доступ к ресурсу во время выполнения, просто создайте ссылку на него, как на любой другой член класса. В следующем примере демонстрируется получение ресурса растрового изображения с именем “Image01”. Следует отметить, что класс ресурсов входит в пространство имен с именем <projectName>.Properties, поэтому необходимо указать либо полное для имя каждого ресурса, либо добавить соответствующую директиву using в исходный файл, из которого осуществляется доступ к классу ресурсов.

System.Drawing.Bitmap bitmap1 = myProject.Properties.Resources.Image01;

Класс ResourceManager используется внутри свойством получения для создания нового экземпляра объекта.

Getting Help

The Help documentation for Visual Studio is in the MSDN Library, which you can install locally on your own computer or network, and which is also available on the Internet. The local version of the library consists of a collection of compressed HTML files in the .hxs format. You can decide to install either all or part of the library on your computer; the complete MSDN installation is close to 2GB and it includes documentation for many Microsoft technologies. You can view both the local and the online MSDN documentation by using the Visual Studio Help browser called Microsoft Document Explorer.

There are eight ways to access documentation when you are working in Visual C#:

Online vs. Local Help

On the Help Options property page under the Options menu, you can specify the following options for search and F1 search behavior:

These options will also appear the first time that you invoke any search. The online MSDN documentation may contain more recent updates than the local documentation. Therefore, if you have an Internet connection and are working in Visual C#, set the search option to try the online MSDN library first. From time-to-time, updates to local documentation may be made available for download.