Vous êtes sur la page 1sur 3

I've added a using to my C# source file, but it's still telling me that I have u

ndefined types. What am I


doing wrong?
Is there any sample C# code for simple threading?
2
The following is a list of common questions about C# with answers from the C# Te
am.
Why does DllImport not work for me?
My switch statement works differently! Why?
What is the difference between const and static read-only?
How do I do implement a trace and assert?
How do I make a DLL in C#?
Why do I get a syntax error when trying to declare a variable called checked?
What is the syntax for calling an overloaded constructor within a constructor (t
his() and constructorname()
does not compile)?
Is there an equivalent to the instanceof operator in Visual J++?
How do I use enum's in C#?
Why do I get an error (CS1006) when trying to declare a method without specifyin
g a return type?
I have several source files, each of which has a Main() method. How do I specify
which of those Main()'s is
supposed to be used?
Does Console.WriteLine() stop printing when it reaches a NULL character within a
string?
Is it possible to use multicast delegates in C#? What's the syntax?
How do I create a Delegate/MulticastDelegate?
Why does my Windows application pop up a console window every time I run it?
Is there a way to force garbage collection?
Does C# support C type macros?
Why is the compiler referencing things that I'm not telling it to reference?
How do you directly call a native function exported from a DLL?
What's the syntax for a static initializer for my class?
Is it possible to have different access modifiers on the get/set methods of a pr
operty?
How do I create a multi-language, single-file assembly?
Does C# support properties of array types?
How do I create a multi-language, multi-file assembly?
How do I simulate optional parameters to COM calls?
Is there an equivalent to C++'s default values for function arguments?
Is there a way of specifying which block or loop to break out of when working wi
th nested loops?
How do I get deterministic finalization in C#?
Does C# support variable arguments (vararg's) on methods?
How do I convert a string to an int in C#?
Is there an equivalent of exit() for quitting a C# .NET application?
How do you specify a custom attribute for the entire assembly (rather than for a
class)?
How do I register my code for use by classic COM clients?
When using multiple compilation units (C# source files), how is the executable's
name determined?
How does one compare strings in C#?
Can I define a type that is an alias of another type (like typedef in C++)?
What is the difference between a struct and a class in C#?
How can I get the ASCII code for a character in C#?
From a versioning perspective, what are the drawbacks of extending an interface
as opposed to extending a
class?
Is it possible to inline assembly or IL in C# code?
Is it possible to restrict the scope of a field/method of a class to the classes
in the same namespace?
If I return out of a try/finally in C#, does the code in the finally-clause run?
Does C# support try-catch-finally blocks?
Is it possible to have a static indexer in C#?
What optimizations does the C# compiler perform when you use the /optimize+ comp
iler option?
How can I access the registry from C# code?
I'm trying to implement an interface defined in COM+ runtime. "public Object* Ge
tObject() { ... }" doesn't
seem to work. What can I do?
Does C# support templates?
Why do I get a CS0117 error when attempting to use the 'Item' property?
I was trying to use an "out int" parameter in one of my functions. How should I
declare the variable that I
am passing to it?
Is there an equivalent to C++'s reference parameters in C# (that is, void foo(in
t &i))?
How do I declareinout arguments in C#?
How do destructors and garbage collection work in C#?
Why do I get a "CS5001: does not have an entry point defined" error when compili
ng?
How do I port "synchronized" functions from Visual J++ to C#?
How do you implement thread synchronization (Object.Wait, Notify, and CriticalSe
ction) in C#?
1
How do I call the base class's implementation of an overridden method?
Is there regular expression (regex) support available to C# developers?
Why do I get a security exception when I try to run my C# app?
How can I get around scope problems in a try/catch?
What is the equivalent to regsvr32 and regsvr32 /u a file in .NET development?
Does C# support parameterized properties?
Q: Why does DllImport not work for me? A: All methods marked with the DllImport
attribute must be marked as public static extern.
Q: My switch statement works differently! Why? A: C# does not support an explic
it fall through for case blocks.
The following code is not legal and will not compile in C#
Does C# support #define for defining global constants?
How can I create a process that is running a supplied native executable (e.g., c
md.exe)?
How do you mark a method obsolete?

Vous aimerez peut-être aussi