1. Explanation of DBNull:This class is used to indicate that no known value exists (usually in database applications ).In database applications, empty objects are valid values of fields. This class distinguishes between null values (empty objects)
When C # is used to read text files, if it contains Chinese characters, garbled characters often occur. The general solution is to add an Encoding in StreamReader. I am using Encoding. UTF8. Generally, this parameter can be used. However, this time
Susing System. Net;Using System. IO;Using System. Text;// Method 1:// Create a request for the URL.
WebRequest request = WebRequest. Create ("http://www.hao123.com /");// If required by the server, set the credentials.Request. Credentials =
Make an input interface today. There is a need to select a different one based on a DropDownList. Different Input interfaces are displayed in the following sections. If you place the RESPONSE event on the server, you must frequently click the page.
When writing code today, I was lazy and used dynamic. As a result, I encountered a problem and I was unable to get the attributes of the dynamic object at runtime. The original problem is simplified as follows:
Assembly A contains the SampleClass
There are many methods to obtain the path in c #, which are generally used in the following five ways:
// Obtain the current working directory of the application.
String path1 = System. IO. Directory. GetCurrentDirectory ();
MessageBox. Show ("Get
The OleDbConnection. GetOleDbSchemaTable method can be used to obtain the Architecture Information of the data source to be retrieved. It is usually used as follows:
DataTable Schemadt = OleDbConnection. GetOleDbSchemaTable (OleDbSchemaGuid. Tables,
Before. Net 4.0, in order to make search engine-friendly and user-friendly URLs, We need to rewrite the URLs by ourselves. Now we don't need it. Net 4.0 is doing this for us. UrlRouting is called Routing because it not only implements Url rewriting,
First paste the code
Private bool isMouseDown = false;Private Point mouseOffset; // records the coordinates of the mouse pointer.
Private void PicBox_MouseDown (object sender, MouseEventArgs e){If (e. Button = MouseButtons. Left){MouseOffset. X = e.
Compile and execute code at runtime. As shown below.
Open button to Open any text file and load it to TextBox. It can be changed after loading.
Compile and execute the Compile button. The Code is as follows.
Code
Code highlighting produced
1. DateTime numeric typeSystem. DateTime currentTime = new System. DateTime ();1.1 take the current year, month, day, hour, minute, secondCurrentTime = System. DateTime. Now;1.2 get current yearInt Year = currentTime. Year;1.3 take the current
Use @ to define a string to indicate the character following the compilation as a string
For example: string str = @ "C: WindowsExplorer.exe" the system automatically changes the string to "C: \ Windows \ xplorer.exe" during compilation"
Equivalent
The introduction of Linq in C #3.0 makes a profound change in the control of collections. The hero behind this change is the extension method and anonymous type. Here we will talk about anonymous and implicit type variables in C.
I,Anonymous
Recently, I used C # To Operate excel. I mainly read the excel template, copied the sheet page of the template, generated multiple sheet pages, filled the corresponding data, and saved it to the excel file, the knowledge points used are as follows.
1
I encountered this problem yesterday afternoon, but the debugging was always successful, but the data was not updated. After searching on the Internet, there are still few such items, probably because the Access database is rarely used, or because
The FindControl method of the System. Web. UI. Control class appears simple enough to use. In fact, the MSDN description of the method is one simple sentence:Searches the current naming container for the specified server control.The key to using
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