1. avoid locking public objects.
If the instance can be accessed by the public, the lock (this) problem occurs.
If there is a class myclass, this class has a method that uses lock (this) to achieve mutual exclusion:
1 Public Class myclass 2
Identify the location of the largest element in the array using the rule and grouping policy. The problem itself is simple, and there are many more efficient implementation methods,This article aims to introduce the idea of Rule delivery and rule
A small feature, which has already been implemented. I used it in a project. I think it is necessary to record it and write it down.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
/*
Design Mode: simplified architecture
I. Pipeline Creation
1. Ticket Mode
Note: There is a kind that determines which kind of sub-class to be practically instantiated in the single-sheet bearing structure.
2. Work order method mode
1. Define an extension type globalizationextensions
The token generation is as follows:
View code
Public Static Class Globalizationextensions{ /// /// Render the globalize resource text /// /// The HTML helper /
I was not prepared to study C # at first, but after graduation, I was scraped over by the financial tsunami. I remember that I started to look for a job before graduation. Fortunately, I didn't know anything about it, and I was very diligent, so I
1. Establish homecontroller class and inherit asynccontroller
The token generation is as follows:
View code
Public Class Homecontroller: asynccontroller{ Public Void Indexasync (){Viewbag. Message = " Welcome to ASP. net mvc! "
Recently, static classes have encapsulated many things, so there are many studies on static classes. The following is the conclusion.
Static variables are a public variable memory, which may conflict with each other.If it is a static method, it
First Note: posted on Mr. Li Jianzhong's website www.lijianzhong.com to encourage you to learn more.
I received a letter from a recent C # training student. Although the student lacks skills in the past, he has a strong learning base and is
CLR via C # is a classic textbook about CLR. It has always been intended to read well, but has never been read.
At the end of last year, I finally made up my mind to buy a paper CLR via C #. On New Year's Day, I went to my home to study in closed
Public Class Coverexcelltoimage{ Private Static String Saveexceljpg = @" C:/temp/11202.16.jpg " ; Private Static Readonly String [] Arrrang = New String [] { " A " , " B " , " C " , " D " , " E " , " F " , " G " , " H
To understand the C # garbage collection mechanism, let's first talk about the CLR (Common Language Runtime when a common language is running). It is a runtime environment like a Java Virtual Machine. Its core functions include memory
In this blog post, it may be difficult to say something. I was prepared to update it the day before yesterday, but I have been unable to find a proper statement for repeated consideration, I may not understand it very well. Therefore, in this blog
About two years of. Net experience, one year of BMC experience, as an electronic professional, is still in mind for C and C ++.
Recently, when the project is idle, check windows programming and windows via C/C ++, and use C ++ to create and
1.Event principle:
Before explaining the principles of an event, let's take an example as follows:
1. Start Vs and create a winform ApplicationProgramIn the form window, create a button. When you click this button, the message "you clicked me!"
0 (the most basic technique), get the content of a row (a cell) in a column
This. currentposition = This. datagridview1.bindingcontext
[This. Maid]. position;
Bookcontent = This. database. dataset. Tables [0]. Rows[This. currentposition] [21].
I saw an article about Napoleon on Douban. The translation of liberal arts students was quite expressive and had to admire the power of Chinese. Available for useProgramThe language has been implemented. Now Java, Python, and HTML versions are
1. datetime numeric type
System. datetime currenttime = new system. datetime ();
1.1 take the current year, month, day, hour, minute, second
Currenttime = system. datetime. now;
1.2 get current year
Int year = currenttime. Year;
1.3 take the current
It's just a little trick.
Ajax has become an inevitable idea when it comes to calling the background C # method in front-end Js.Only the implementation details use Ajax 1.0 or ajaxpro.In fact, without Ajax, we can also easily use js to call the
In the preface, you should have a little understanding of the importance of delegation and events. Although we can still be vague, from my vernacular series, I will make these concepts easy to understand. First, let's talk about delegation first.
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