When we use directoryinfo dir = directory. when createdirectory (pathname) is used to create a directory or a file, it must be deleted after it is used up as a temporary file. delete () or directory. delete () often encounters an "Access Denied
What is an anonymous method? The anonymous method is a new feature introduced by C #2.0. It allows developers to declare their own functions.CodeYou do not need to use a delegate function. C # provides a mechanism for delegation. You can define
The delegate can be understood as follows: it is a data type, similar to the reference type, but compared with the general class, the delegate instance is not the data in the heap, but a method. The delegate is similar to the reference type and
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 take the current year int year = currenttime. Year;
1.3 The
The obsolete attributeProgramThe entity is marked as an entity that is not recommended for use. Every time an object is marked as obsolete, a warning or error is generated, depending on how the attribute is configured. For example:
The above
This article introduces howProgramChina Mobile untitled window
C #
There are two methods to sum up in C:
1. You can control the status of the form by clicking and moving the left mouse button,CodeSee:
Point offset;
Private
Void
Preface
This conversion is actually very simple. The most important thing is to reference the class library first. You can go to the official website to download reference http://json.codeplex.com.
Two days ago, I learned how to submit JSON
16. Two new usage methods
Instantiate object new class (); hide the base class method, that is, override method public new XXX (){}
17. Delegate and event usage
Public Delegate void handles (); // defines the delegate. the return value is void
A few days ago, I became familiar with and familiar with delegation. I had never been involved with delegation before, so I searched the internet and recorded and practiced it briefly, this is recorded in the blog. Today, I just have time to review
fuzzy search is often used in data systems. However, fuzzy search provided by databases does not support sorting by relevance.
now we provide a method to compare the similarity between two strings.
by calculating the similarity between the two
In addition to defining generic classes, you can also define generic methods.
Define T as a generic type in method swap. There are two parameters, one variable temp.
Public Static VoidSwap (RefT x,RefT y) {T temp; temp=X; x=Y; y=Temp ;}
Call:
During system development, system configuration parameters are often stored in XML files. The advantage is that you do not need to read the database when calling parameters, in addition, the system parameter cache can be used to set file
Preface
A common method used by catch and finally is to obtain and use resources in the try block, handle exceptions in the Catch Block, and release resources in the Finally block.
Catch
Catch this will catch any exceptions.
Catch (exception
In the ApplicationProgram.WidgetDrag to another control, you need to use the drag-and-drop technology.Procedure:(1) create a new form, add two label controls and two textbox controls to the form, and name the two textbox controls txtdatatart and
In my essay "using pointers to image pixels in C #", I introduced two unsafe methods. The advantage lies in the improvement of time efficiency, but C # is a secure language. Here we will introduce a highly efficient security method --
I found a
This article summarizes the usage of C ++ pointers.
In C ++, it is best not to use new/delete pointers, but to use smart pointers to manage resources. Smart pointers are boost's best job. The source code and usage of boost can be found on the
1. Go from System. String [] to List
List List = new List (); string [] str = {"1", "2", "3"}; List = new List (str );
2. Go from List to System. String [].
List List = new List (); List. add ("1"); List. add ("2"); List. add ("3"); System.
The conversion using generics and reflection is awesome. The code is supplemented with detailed comments. A little understanding of generics and reflection can help you understand the essence of conversion. You can copy, paste, and call it.Public
1 c # process-related sorting234. What is the process username obtained based on the process name?56. Add a reference to System. Management. dll.78 using System. Diagnostics;9 using System. Management;1011 static void Main (string [] args)12 {13
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