Window operating system, everywhere is the formAdvantages: Simple, powerful, convenient and flexibleStep: Create a new Project project type Visual C # project Template window applicationSeparate the code for the same form into two files with partial:
Constructor and object initializer
Constructor:Used to instantiate an object.
Generally, a default no-argument constructor exists in the class or struct. If we manually write a constructor with parameters in the class, the constructor without
Data type conversion (packing and unpacking) and constants, Data Type Packing Constants
Implicit conversion [automatic type conversion]:The two types must be compatible. The original value range must be smaller than the target value range, which can
Passing parameter to an event handler [stackoverflow],
Q:
I want to pass myListAs parameter using my event
public event EventHandler _newFileEventHandler; List _filesList = new List();public void startListener(string directoryPath){
C # (string method summary ),
1. character array and String Conversion
(1) ToCharArray () converts a string into a character array
String s = 'blog I like ';
Char [] chs = s. ToCharArray ();
(2) obtain the string from the character array new string (
C # Read txt files in fixed text format,
C # Read txt files in fixed text format
A simple C # program for reading txt documents, which stores instance data in a fixed format.
// Determine whether the keyword has var isTr = File in the
C # create, deploy, and call WebService,
Webservice can be used for interaction between distributed applications and between different programs.
There are not many conceptual things. The following is an example of creating a simple webservice.
Abclearning entry series (5) (display to add, delete, modify, and query)
The general effect is as follows:
1. Add Controller (the X. PagedList used is noted that nuget is added)
Using System. web. mvc; using Abp. application. services. dto; using
Bad taste of code [2]
Total returned directory
4. Long Parameter List (too Long Parameter column)
Too long parameter columns are hard to understand. Too many parameters may cause inconsistency and are not easy to use.
1. Generally, if there are
C # Json summary,
JSON formatting will occur when writing C #. The following code preliminarily summarizes how to use it.
Newtonsoft. Json. dll must be referenced in either of the following ways:
1. Use JsonSerializer
class JosnUnit {
In C #, struct is defined and converted into byte arrays,
Recently, the structure and byte array conversion were used in socket communication packet parsing. Because the client adopts C ++ development, the server adopts C # development, therefore,
C # large List memory allocation,
Previously, when I used the List only in development, I used it almost just by taking it over. I never considered the List memory allocation problem, imagine how the memory of a 0.1 million yuan List changes when
C # obtain the system time and time format conversion,
-- DateTime numeric typeSystem. DateTime currentTime = new System. DateTime ();Returns the current year, month, day, hour, minute, second, currentTime = System. DateTime. Now;Int Year =
C # Response download,
// Download TransmitFile
protected
void
Button1_Click(
object
sender, EventArgs e)
{
/*
Microsoft provides a new TransmitFile method for the Response object to solve the problem of using
C # string fuzzy match recursion,
Using split and Recursion
Private int search (string strValue, char [] searchchar, int index) {var temp = strValue. split (searchchar [index]); var countt = temp. count (); if (countt> 1) {++ index; if (temp [0].
. Net-C # asynchronous program knowledge point sorting,
Thread:Each Windows process has a Main Thread used to enter the entry point of the program, for example. the Main () method is used as the entry point of the program. When you call this
Use C # To compile a simple notebook,
Using System; using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. linq; using System. text; using System. threading. tasks; using System.
C # reflection,
. Net is often used to dynamically load DLL, and DLL may contain various parameters, methods, forms. How to call to dynamically load these parameters, methods, and forms?
In C #, we need to use reflection. First, we need to
Solution for Newtonsoft. Json version conflict,If different third-party libraries in the same project use different versions of Newtonsoft. in the case of Json, you can add the following nodes to the configuration file of the main project. json is
An exception of the "System. NullReferenceException" type occurs in App_Web_2tjb2nqh.dll, but not in user code (C # development ),
An exception of the "System. NullReferenceException" type occurs in App_Web_2tjb2nqh.dll, but not in user code.
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