Code from http://topic.csdn.net/u/20101231/09/039bdd22-3f0a-4bbb-908e-d887b4d7bbfe.html? 19933
Public static class util {// // check whether the ID card information is valid /// 2010-10-13 jorln /// /// ID card number /// gender /// Public
C # Use reflection to retrieve all attribute names of a class and the values of all attributes of the class's instances
Summary:Corresponding to the instantiated object Tc of a class, traverse the method for getting all attributes (sub-members)
Objective: To paging strings
Idea: button control
Specific implementation process:
Generate two buttons named respectively on the previous page and next page
Use stringsChars_hanzi.substring (I, j) // I indicates the start position of the index,
Due to data import, when a MySQL DATA table contains a Unix timestamp, the SQL Server database cannot be imported #ProgramConvert the time format and import it to the SQL server data table.
String timestamp = "1191030513613 ";Datetime dtstart =
1. New and delete
Int * Pi = new int (0); // initialize the value to 0a * pA = new A (); // For the custom type, create an object in two steps, the first step is to allocate memory. The second step is to call the constructor. Pa-> function ();
Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. net;
Using system. windows;
Using system. Windows. controls;
Using system. Windows. documents;
Using system. Windows. input;
Using system. Windows. Media;
Using
I used to have a long question: in C #, is the class faster or the structure faster?At that time, I did not go into detail.
Recently, I have encountered a problem. I need to encapsulate some large pointer operation code. Originally for performance,
Reference namespace first:Using system. diagnostics;
Example:
// Open Baidu in the existing window
System. Diagnostics. process. Start ("http://www.baidu.com ");
// Open Baidu in a new windowUsing system. diagnostics;Process PS = new process
In C # projects, JSON strings and object data types are sometimes used for conversion. The following is a conversion tool class:
Note: when an object is generated based on a JSON string, it is assigned a value based on the corresponding attribute
To remove all the HTML tags except the paragraph tags, as long as the text on the page is like the effect of sticking the code to notepad and removing the Code such as links. You can try it.Public static string delhtml (string htmlstring) // remove
// Remember to add an application
// Add an application by right-clicking the application button in resource manager, and then finding Microsoft. offoce. word.11 in. net
// Wish you a pleasant learning experience ....
Using system;Using system.
This article is purely for the exchange of garden friends. How many types can you write?ReturnUse Cases, pay attention to the form of use. (Please add..)
C # MediumReturnKey subwords are a commonly used syntax. However, have you used all their forms?
Let's take a look at card games first. A card is composed of 52 different cards. It must generate non-repeated cards during licensing and the shuffling process must be fair, that is, 52! The order of cards should be equal to the probability.
Overview
A function object is a class object that contains the overload () operator. That is, this class implements the operator () function. STL defines a set of standard function objects as templates, which can be used to create a function object.
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
I. Introduction to transactions
. NET Framework developer GuideA transaction is an operation that combines logical units of work. Although errors may occur in the system, the transaction controls and maintains the consistency and integrity of each
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Protected void button#click (Object sender, eventargs E)
{
String message = string. empty;
Person = new person ("James ");
Type type = person.
// Obtain the type T = type. GetType ("myclass") with the name "myclass ");
// Obtain the attributes of "myclass"
Propertyinfo [] properts = T. getproperties ();
// Obtain an Attribute Based on the attribute name
Propertyinfo P = T. getproperty ("ID
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