Summary of. NET Web Development

Source: Internet
Author: User
Tags switch case

Creating controls in an ASPX file in the lower-right corner with control information sort by class will sort the control information installation class

Clicking on the control increases the paging [events] page of the property page to increase its event function

string manipulation and its time operations

Fn_name. Insert (0, "large"). The ToString () string is input from "0123" starting at 0, and input 0 is displayed at the front of the character 1 is displayed after 1
Variable. Insert (int,sring). ToString (); Increment the specified position string
Variable. Remove (Int,int). ToString (); Delete the specified position string
Variable. Replace (string1,string2);//replace string String2 replacement string1
Variable. Substring (int,int);//intercept a string to intercept several characters from a character
* * Date String Interception * * Chapter 4
Intercept string to intercept generated date variable string
DateTime class to get time requires a real column DateTime class
DateTime time = new DateTime (2006,5,20); Real-column and initialize

DateTime DDate1 = time. AddDays (int)//AddDays action can modify the number of days based on the date that is actually obtained
(-int)//Increase int decrease-int
DateTime DDate2 = ddate1.addmonths (23)//modified month on the basis of its DDate1 date
(-23)//Increase int decrease-int
AddYears year

DateTime.Now Get the current date
CompareTo is a date comparison such as:
Ddate1.compareto (DateTime.Now) Comparison of the date and the current date
int now_h = DateTime.Now.Hour; Get Current Hour
Ddate1.dayofweek = Output Week
Response.Write ("<br/>"), can have HTML code but note that Response is displayed on the page text can use HTML text code.

Two bars
* * Type Conversion * * Date type formatted output and type string split

Tip: Response.Write ();//Escape + can connect string

A: First introduce. NET several basic types
BYTE 8-bit unsigned integer type: 1 bytes
Short 16-bit signed integer type: 2-byte short integer type
int 32-bit signed integer type: 4 byte integer type
Long 64-bit signed Long integer type: 8 bytes
Float single-precision floating-point number
Double dual-precision floating-point number
Two: type conversion
Double-int
Double num = 3.1415926;
int number = (int) num;//Display type conversion Universal

string int
String sql = num. ToString (); Universal Time Type (DateTime) can also be converted

String->string[] or char[]

String sql = "Zhao Yun";
char[] path = SQL. Tochararry (); Note that the ToCharArray is an array type that array is a C # array type

Split String * * *
String se = "big luck Everyone";
string[] sq = se. Split (' big '); Assigning a large character split in an SE string to an stirng array

Date formatted as Short date (date formatted output type)

such as: Datatiem B = new Datetiem (2006,3,23,23,13,56);
Month and day time
Response.Write (B.tostring ("D") + "<br/>");//To Tostirng ("D");//The date format shown is:
2006.3.23 Thursday show year-month-day week

Output format: b.tostring ("D"); = year-month-day week
B.tostring ("dddd HH:mm:ss"); = Week: minute: seconds dddd Week hh mm min SS sec
B.tostring ("yyyy mm DD day") = year-month Day
Three-Bar * * * Process Control
Random number generator The class and the date class need to be real-listed to use
Random rnd = new Random ();
int a = rnd. Next (10); Next function is to return less than the specified maximum worth of non-negative
Switch Case:default:break;
If else if else
For
Do While
While
While
String kstr = "";
Kstr.padleft (N, ' * ').  Tostirng (); The PadLeft returns a new string n that represents the string length, ' * ' for the new value
Kstr.length: Get string length

Convert a string to a time type
DateTime D = DateTime.Parse (String);

  

Summary of. NET Web Development

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.