using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Data.SqlClient;
using System.Security.Permissions;
namespace ConsoleApplication1
{
[SqlClientPermission(SecurityAction.Demand)]
public class Class1
{
public void Test()
{ }
}
class Program
{
static void Main(string[] args)
{
Class1 c;
Stopwatch w = new Stopwatch();
w.Start();
for (int i = 0; i < 10000; i++)
{
c = new Class1();
c.Test();
}
w.Stop();
Console.WriteLine(w.ElapsedMilliseconds);
}
}
}
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.Data.SqlClient; using System.Security.Permissions;
------解决方案-------------------- 楼主挺有钻研精神。电脑上没装4.0的,不然就测试一下。
------解决方案--------------------