1、C#中 property 与 attribute的区别,他们各有什么用处,这种机制的好处在哪里?
property和attribute汉语都称之为属性。不过property是指类向外提供的数据区域。而attribute则是描述对象在编译时或运行时属性的。这两者是有本质区别的。
2 .列举ASP.NET 页面之间传递值的几种方式。
(1)使用QueryString, 如....?id=1; response. Redirect()....
(2)使用Session变量。
(3)使用Server.Transfer
3. 一列数的规则如下: 1、1、2、3、5、8、13、21、34...... 求第30位数是多少, 用递归算法实现。
public class MainClass
{
//主函数调用输出低30的数值
public static void Main()
{
Console.WriteLine(Foo(30));
Console.ReadLine();
}
//方法封装,参数为第几个,求第30个
public static int Foo(int i)
{
if (i <= 0)
{
return 0;
}
else if (i > 0 && i <= 2)
{
return 1;
}
else
&nbs