Puzzle 28: cyclist
Now it's your turn. What kind of statement can turn the following loop into an infinite loop?
While (I = I + 1)
{
}
Q & A 28: loop Operator
Check the while loop carefully. It seems that it should be terminated immediately. A
I. Delegation
A delegate is similar to a function pointer, but a function pointer can only reference static methods. A delegate can reference both static methods and instance methods.
Delegation is divided into three steps: 1. Delegation
Today I encountered a thread call with a function, but it would not work if I used the conventional idea, as shown below: Code : Historyrecord HR = New Historyrecord ();Datetime starttime = New Datetime ( 2007 , 12 , 3 , 16 ,
Public class class1
{
Delegate int deleadd (int A, int B); // delegate statement
Delegate int deleremove ();
Public class1 (){}
Public static void start (){Class1 C1 = new class1 ();
Deleadd add = new deleadd (c1.add); // instantiate the
:
Http://james.newtonking.com/
Download: JSON. Net 3.5 release 8-3.5 final full version. Net latest (3.5 SP1) 3.5
Example:
Public Class Message
{
Public StringAddress {Get;Set;}
[Jsonproperty(Typenamehandling =Typenamehandling.
Puzzle 01: odd
The purpose of the following method is to determine whether the unique parameter is an odd number. Is this method feasible?
Public static bool isodd (int I)
{
Return I % 2 = 1;
}
Confusing 01: odd
An odd number can be defined as an
=== Program that uses streamreader [C #] ===
Using system;Using system. IO;
Class Program{Static void main (){//// It will free resources on its own.//String line;Using (streamreader reader = new streamreader ("file.txt ")){Line = reader.
Reflection is usually used for the following purposes.
(1) Use Assembly to define and LoadProgramSet, load the module in the assembly list, and find the type from this Assembly and create instances of this type.
(2) Use the module to understand
As the object creation mode, the singleton mode ensures that a class has only one instance, and the instance is self-instantiated and provided to the entire system. This class is called a singleton class.
The Singleton mode has the following
I am from the reflection process of Java. I want to know the reflection process of C #, so I wrote a Summary of the knowledge, hoping to help later.
·
3Use MethodinfoThe following information is found: method name, return type, parameter,
I am from the reflection process of Java. I want to know the reflection process of C #, so I wrote a Summary of the knowledge, hoping to help later.
Reflection provides a descriptionProgramSet, module, and type object (type ). You can use
Puzzle 34: knocked down by counting
This
Program What will it print?
Class count
{
Static void main ()
{
Const int start = 2000000000;
Int COUNT = 0;
For (float F = start; F Count ++;
System. Console. writeline (count );
}
}
Confused 34: knocked
The measurestring method in the graphics class.DescriptionGraphics. measurestring (string, font) measures the specified string drawn with the specified font.Supported by. NET Compact framework.
Graphics. measurestring (string, Font, int32)
I flipped through. net in the past two days.ProgramAn interesting topic was found during the staff interview: compile a programSource codeThe source and content are printed on the command line after the program runs.CodeIdentical. If you don't think
In. when using regular expressions in. net, some options will be of great help. The options are generally represented by a letter, when using the RegEx class, we can use enumeration or input in the constructor, as shown below:
RegEx r =NewRegEx (@"
Regular Expressions are often used and changed recently. If you want to write a regular expression as a constant, you need to escape it. If it is configured in XML, It is troublesome. In addition, special characters in XML also need to be escaped.
Puzzle 04: elementary questionsThe following program only involves addition. What does it print?Class Elementary{Static void Main (){System. Console. WriteLine (12345 + 5432l );}}
FAQ 04: primary problemsOn the surface, this is like a simple
Puzzle 26: in a loopThe following program calculates the number of iterations of a loop and prints the Count value at the end of the loop. So what does it print?Class InTheLoop{Const int END = int. MaxValue;Const int START = END-100;Static void Main
Like the program in puzzle 26, the following program also contains a record of the number of iterations before termination. Different from that program, this program uses the Left shift operator (Class Shifty
{
Static void Main ()
{
Int I = 0;
Link: http://hi.baidu.com/liyanlin84/blog/item/d235402483d0f7358644f96b.html
C # mutual calls between code and javaScript Functions
Q:1. How to access the C # function in JavaScript?2. How to access the C # variable in JavaScript?3. How to access
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