Αποτελέσματα Αναζήτησης
25 Ιαν 2010 · It's not exactly like C's #include directive, but C#'s using statement is what you're after: using Assembly.Name; It works at a namespace level, rather than a file level. So, if class.cs includes a public class named SomeClass in the Application.Core namespace, this would look like: using Application.Core;
25 Αυγ 2014 · The compiler doesn't know that the actual object contained in getitem is of type MyClass, because you've told it to expect an object, which could be just about anything. Imagine you'd done this instead: List<object> items = new List<object>(); items.Add( "Hello, World!" ); object getitem = items[0]; int itemid = getitem.id; // <-error
25 Απρ 2024 · The using directive allows you to use types defined in a namespace without specifying the fully qualified namespace of that type. In its basic form, the using directive imports all the types from a single namespace, as shown in the following example: C#. Copy.
1 Φεβ 2023 · #if, along with the #else, #elif, #endif, #define, and #undef directives, lets you include or exclude code based on the existence of one or more symbols. Conditional compilation can be useful when compiling code for a debug build or when compiling for a specific configuration.
25 Οκτ 2021 · For example this error will occur if a class has a public field of a type that is defined as internal. This error usually occurs when developers forget to mark a class as public. Remember that classes have a default access modifier of internal when no access modifier is specified.
7 Φεβ 2024 · Certain exceptional conditions that arise during the processing of C# statements and expressions cause an exception to be thrown in certain circumstances when the operation cannot be completed normally. See §21.5 for a list of the various exceptions that can be thrown in this way.
11 Οκτ 2024 · #include is a way of including a standard or user-defined file in the program and is mostly written at the beginning of any C program. The #include preprocessor directive is read by the preprocessor and instructs it to insert the contents of a user-defined or system header file in our C program.