Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#Ó÷ºÐÍ£¬Ê¹³ÌÐò¸üÁé»î£¬Ò²¸üÊ¡ÐÔÄÜ

ÏÈÉùÃ÷£¬ÎÒ²»ÊÇÕâ·½ÃæµÄר¼Ò£¬Ö»ÊǸÉÈí¼þËĸöÔ²»ÖªÌìÓжà¸ßµØÓжàÓ²µÄСº¢×Ó
Ê×ÏÈ£¬ÀàÐÍת»»ÊÇÓÐÒ»¶¨¿ªÏúµÄ
ÎÒÊÔ¹ýÕâÑùµÄ´úÂ룺ÕâÊÇÒ»¸ö¿ØÖÆ̨ӦÓóÌÐòµÄProgramÀàµÄ´úÂë
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ÀàÐÍת»»µÄ¿ªÏú
{
class Program
{
static void Main(string[] args)
{
DateTime now = DateTime.Now;
for (int i = 0; i < 10000000; i++)
{
I a = new A();
((A)a).M();
}
Console.WriteLine(DateTime.Now - now);
now = DateTime.Now;
for (int i = 0; i < 10000000; i++)
{
A a = new A();
a.M();
}
Console.WriteLine(DateTime.Now - now);
}
}
interface I
{
string M();
}
class A : I
{
public string M()
{
return "MA";
}
}
class B : I
{
public string M()
{
return "MB";
}
}
}
 
ÔËÐеĽá¹ûÊÇÕâÑù£º
00:00:00.3125000
00:00:00.2187500
Çë°´ÈÎÒâ¼ü¼ÌÐø. . .
Ò»ÒڴΣ¬¾ÍÒª¶àÓÃ0.1ÃëÖÓ
ÎҵĻú×ÓÊÇ CPU 2.7GHzË«ºË£¬ 2GÄÚ´æ
ËùÒÔ£¬ÎªÁËÕâôϸСµÄ¶«Î÷£¬ÎÒƽʱд´úÂ룬Ҳ¾¡Á¿Ê¡µÃ¾ÍÊ¡¡£
·ºÐÍÎÒÓõúܶ࣬²»¹ý¶¼Ã»ÓÐÉîÈëȥѧ¡£²»¹ý×î½üÔÚÑо¿¹ý£¬·ºÐͶ¼¿ÉÒÔʵÀý»¯£¬Õâ¸ø±à³Ì´øÀ´ºÜ´óµÄ·½±ã¡£
ͬÑùÊÔÊÔÏÂÃæµÄ´úÂ룺
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ÀàÐÍת»»µÄ¿ªÏú
{
class Program
{
static void Main(string[] args)
{
A<B> a = new A<B>();
DateTime now = DateTime.Now;
for (int i = 0; i < 1000000; i++)
{
a.M().M();
}
Console.WriteLine("ÓÃÁË·ºÐ͵Äʱ¼ä£º" + (DateTime.Now - now));
now = DateTime.Now;
for (int i = 0; i < 1000000; i++)
{


Ïà¹ØÎĵµ£º

asp.net(c#) ·µ»ØÉÏÒ»Ò³

Õª³­Ç°±²ÃǵÄ
ÆäʵҪʵÏÖÕâ¸ö¹¦ÄÜÖ÷Òª»¹ÊÇÒªÓõ½javascript
·½·¨Ò»£º
ÔÚasp.netµÄaspxÀïÃæµÄÔ´´úÂëÖÐ
<input type="button onclick="javascript:window.history.go(-1);"value="·µ»ØÉÏÒ»Ò³">
dzÎö£ºÕâ¸öÊÇÓÃÁËHTML¿Ø¼þ£¬Í¨¹ýÒ»¸öonclickµÄʼþ£¬µ÷ÓÃÁËjavascriptÖеÄÒ»¸ö·½·¨¾Í¿ÉÒÔÁË¡£Õâ¸öÊÇ×î¼òµ¥µÄÁË£¬Ò²Í¬Ñù ......

asp.net(c#)»º´æCache¶ÔÏó£¨Ñ§Ï°ÈÕ¼ÇÒ»£©


ʲôÊÇCache¶ÔÏó?
ÄãÔÚÉú³É¸ßÐÔÄÜÍøÂçÓ¦ÓóÌÐòʱËùÓöµ½µÄÒ»¸öÎÊÌâ¾ÍÊÇÐèÒª±ÜÃâÖظ´¡£Ò»¸öCache¶ÔÏóÔÊÐíÔÚËüÃǵÚÒ»´Î±»ÇëÇóʱÔÚÄÚ´æÖлº´æÏȻºó½«±»»º´æµÄ¸±±¾ÓÃÓÚÒÔºóµÄÇëÇó¡£Ê¹Óñ»»º´æµÄ¸±±¾ÔÊÐíÄã±ÜÃâÖؽ¨Âú×ãÒÔÇ°ÇëÇóµÄÐÅÏ¢£¬ÌرðÊÇÄÇЩÿ´Î´´½¨Ê±¶¼ÐèÕ¼ÓÐÃ÷ʾµÄ·þÎñÆ÷ÉϵĴ¦ÀíÆ÷ʱ¼äµÄÃüÁî¡£
³ý»º´æ¸ö±ðÏÈç» ......

C#²éѯÊý¾Ý¿â°Ñ½á¹ûÊä³öµ½XMLµÄÀý×Ó

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
//sqlserverÉí·ÝÑéÖ¤
//s ......

C#´ò°üSQLÊý¾Ý¿â²¿Êð°²×°


²Î¿¼¡¶ASP.NETÓëSQLÒ»Æð´ò°ü²¿Êð°²×°¡·
£¬ÕâƪÎÄÕÂÊÇÕë¶ÔVB.NETÓëSQL Ò»Æð´ò°üµÄ,µ«ÊÇÎÒʹÓõÄÊÇC#,µ±È»Ö»ÒªÐÞ¸ÄÒ»ÏÂÖ÷Òª°²×°Àà¿â¾ÍÐÐÁË!C#µÄÀà¿â´úÂëÈçÏÂ:DBCustomAction.cs
using System;
using System.Collections;
using System.Data.SqlClient;
using System.ComponentModel;
using System.Configuration.Inst ......

C#ÖнṹÓëÀàµÄÇø±ð

Ò»£®ÀàÓë½á¹¹µÄʾÀý±È½Ï£º
½á¹¹Ê¾Àý£º
public struct Person
{
string Name;
int height;
int weight
public bool overWeight()
{
//implement something
}
}
ÀàʾÀý£º
public class TestTime
{
int hours;
int minutes;
int seconds;
public void passtime()
{
//implementation ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ