Asp.netÖ® ÀàºÍ½á¹¹µÄÇø±ð
1¡¢ÀàÊÇÒýÓÃÀàÐÍ£¬½á¹¹ÔòÊÇÖµÀàÐÍ¡£Òò´Ë½á¹¹ÊÇ·ÅÔÚÕ»£¨Stack£©ÀÀàÔò½ö½öÊǽ«ÒýÓõØÖ·´æ·ÅÔÚÕ»À¶ø¾ßÌåµÄÖµÔò´æ·ÅÔڶѣ¨heap£©Àï¡£
2¡¢¾ÝµÚ1µã¿ÉÒԵóö½áÂÛ£¬ÄǾÍÊÇÀà¶ÔÏóͨ³£ÓÃÀ´´«µÝ´óÊý¾Ý£¬¶ø½á¹¹¶ÔÏóÔòÓÃÀ´´«µÝСÊý¾Ý¡£
3¡¢Àà¿ÉÒԼ̳кͱ»¼Ì³Ð£¬¶ø½á¹¹Ôò²»Ö§³Ö¡£µ«½á¹¹ºÍÀàÒ»Ñù¿ÉÒԼ̳Ð×Ô½Ó¿Ú¡£
4¡¢½á¹¹¶ÔÏó²»ÄÜÏñÀà¶ÔÏóÒ»Ñù¸³ÖµÎªnull¡£
5¡¢½á¹¹Ã»ÓÐÎö¹¹Æ÷¡£ÀàÓй¹ÔìºÍÎö¹¹º¯Êý¡£
6¡¢½á¹¹²»ÄÜÏñÀàÒ»Ñù¶¨ÒåΪ³éÏóµÄ¡£
7¡¢ÔڽṹÖв»ÄÜÖØд·½·¨£¬³ý·ÇÊÇobjectÀàÐ͵ÄÈçÏ·½·¨£º
Equals()
GetHashCode()
GetType()
ToString()
ÈôÒªÈýṹ¾ßÓжà̬ÌØÐÔ£¬¿ÉÒÔÈÃÆäʵÏÖ½Ó¿Ú¡£
8¡¢ÔÚÀàÖж¨ÒåµÄʼþÊÇḬ̈߳²È«µÄ£¬¶ø½á¹¹Ôò²»ÊÇ¡£
9¡¢½á¹¹×ÜÊǾßÓÐÒ»¸öĬÈϵĹ«¹²Î޲ι¹Ô캯Êý£¬µ«È´²»ÄÜÏñÀàÒ»Ñù¶¨Òå˽ÓеÄÎ޲ι¹Ô캯Êý£¨½á¹¹Ò²²»ÄÜÔÙ¶¨Ò幫¹²µÄÎ޲ι¹Ô캯Êý£¬ÕâÓëÀ಻Ïàͬ£©¡£
10¡¢ÀàÖеľ²Ì¬¹¹Ô캯Êý»á±»µ÷Ó㬶ø½á¹¹È´²»ÄÜ¡£Òò´ËÔڽṹÖж¨ÒåµÄ¾²Ì¬¹¹Ô캯Êý£¬ËäÈ»¿ÉÒÔ±àÒëͨ¹ý£¬µ«È´Ã»ÓмÛÖµ¡£
11¡¢½á¹¹²»ÄÜÏñÀàÒ»Ñù¶¨Òåvolatile×ֶΡ£volatile×Ö¶ÎÖ÷ÒªÓÃÓÚ²¢·¢£¬ËüÏ൱ÓÚ·½·¨ÌåµÄlock¡£
12¡¢¿ÉÒԶԽṹÀàÐÍʹÓÃsizeof£¬¶ÔÀàÔò²»ÐС£
13¡¢ÀàµÄ×ֶλᱻ×Ô¶¯³õʼ»¯Îª0/false/null£¬¶ø½á¹¹Ôò²»ÄÜ¡£
14¡¢ÔڽṹÖв»ÄÜÖ±½Ó¶Ô×ֶγõʼ»¯£¬¶øÀàÔò¿ÉÒÔ¡£
15¡¢½á¹¹ºÍÀà¶ÔÓÚSystem.Object.Equals()·½·¨µÄÌåÏÖÊDz»ÏàͬµÄ¡£
==============Test 01=============
namespace ClassAndStruct
{
class Program
{
static void Main(string[] args)
{
StructTest st = new StructTest(3,4);
Console.WriteLine(st.GetSpace().ToString());//ÕâÀïÊä³ö 12
}
}
public struct StructTest
{
public int length;
public int width;
//½á¹¹Öв»ÄÜÓÐʵÀý×ֶγõʼֵÉ趨Ïî
//public int length=0;
//½á¹¹Öв»ÄÜÓÐʵÀý×ֶγõʼֵÉ趨Ïî
//StructTest structTest = null;
//½á¹¹²»ÄÜ°üº¬ÏÔʽµÄÎÞ²ÎÊý¹¹Ô캯Êý
//public StructTest()
//{ }
public StructTest(int a, int b)
{
length = a;
width = b;
}
public int GetSpace()
{
return length * width;
Ïà¹ØÎĵµ£º
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ·
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ·
///
/// È¡µÃdataset
//
/// ²éѯÓï¾ä
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
1 ASP.NET ·þÎñÆ÷¿Ø¼þGridViewʹÓÃ
±¾½Ì³Ì²»½éÉÜ·þÎñÆ÷¶Ë¿Ø¼þµÄ³ÊÏÖ£¬Ê¼þ´¦Àí£¬×´Ì¬µÈÀíÂÛ֪ʶ£¬Ö»½éÉÜ·þÎñÆ÷¶Ë¿Ø¼þµÄʹÓòÙ×÷£¬Èç¹ûÄú¶Ô·þÎñÆ÷¿Ø¼þµÄ֪ʶ¸ÐÐËȤ£¬Çë²ÎÔÄ¡¶ASP.NET·þÎñÆ÷¿Ø¼þ¸ß¼¶±à³Ì¡·
ÔĶÁ±¾ÎÄʱ×îºÃºÍ Îĵµ ¡¶ASP.NET·þÎñÆ÷¿Ø¼þʹÓÃÖ®Grid ......
µ± ASP.NET ½ÓÊÕÕë¶ÔÒ³µÄÇëÇóʱ£¬Ëü´ÓÏ̳߳ØÖÐÌáÈ¡Ò»¸öÏ̲߳¢½«ÇëÇó·ÖÅä¸ø¸ÃÏ̡߳£
Ò»¸öÆÕͨµÄ£¨»òͬ²½µÄ£©Ò³ÔÚ¸ÃÇëÇóÆڼ䱣ÁôỊ̈߳¬´Ó¶ø·ÀÖ¹¸ÃÏß³ÌÓÃÓÚ´¦ÀíÆäËûÇëÇó¡£Èç¹ûÒ»¸öͬ²½ÇëÇó³ÉΪ I/O bound£¨ÀýÈ磬Èç¹ûËüµ÷ÓÃÒ»¸öÔ¶³Ì Web ·þÎñ»ò²éѯһ¸öÔ¶³ÌÊý¾Ý¿â£¬²¢µÈ´ýµ÷Ó÷µ»Ø£©£¬ÄÇô·ÖÅä¸ø¸ÃÇëÇóµÄÏß³ÌÔÚµ÷Ó÷µ»Ø֮ǰ´ ......
substring
public String substring(int beginIndex)·µ»ØÒ»¸öеÄ×Ö·û´®£¬ËüÊÇ´Ë×Ö·û´®µÄÒ»¸ö×Ó×Ö·û´®¡£¸Ã×Ó×Ö·û´®Ê¼ÓÚÖ¸¶¨Ë÷Òý´¦µÄ×Ö·û£¬Ò»Ö±µ½´Ë×Ö·û´®Ä©Î²¡£
ÀýÈ磺
"unhappy".substring(2) returns "happy"
"Harbison".substring(3) returns "bison"
"emptiness".substring(9) returns "" (an empty string)
² ......