ASP. NET 면접 문제 (1)

1.    private、 protected、 public、 internal         。
  . private :     ,           。 
protected :     ,             。 
public :     ,    ,      。 
internal:             。

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 {
	public static void Main()
	{ 
		Console.WriteLine(Foo(30)); 
	}
	
	public static int Foo(int i) 
	{ 
		if (i <= 0) 
		return 0; 
		else if(i > 0 && i <= 2) 
		return 1; 
		else return Foo(i -1) + Foo(i - 2); 
	} 
} 

4.C#       ?         ?
  :                    。                。
 ,        

5.override      
  :override       。          。         ,              ; Override            。      。

6.     B/S             ,       Session、Cookie、Application,          ?
  :this.Server.Transfer

7.          TextBox        string.Empty?
 :
foreach (System.Windows.Forms.Control control in this.Controls)
{
	if (control is System.Windows.Forms.TextBox)
	{
		System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ; 
		tb.Text = String.Empty ;
	}
}

8.             ?
 :
int [] array = new int;
int temp = 0 ;
for (int i = 0 ; i < array.Length - 1 ; i++)
{
	for (int j = i + 1 ; j < array.Length ; j++)
	{
		if (array[j] < array[i])
		{
			temp = array[i] ;
			array[i] = array[j] ;
			array[j] = temp ;
		}
	}
}

9.    C#         ,            ?
 :  。       。

10.        ,               : 1-2+3-4+……+m
 :
int Num = this.TextBox1.Text.ToString() ;
int Sum = 0 ;
for (int i = 0 ; i < Num + 1 ; i++)
{
	if((i%2) == 1)
	{
		Sum += i ;
	}
	else
	{
		Sum = Sum - I ;
	}
}
System.Console.WriteLine(Sum.ToString());
System.Console.ReadLine() ;

11. .net B/S     ,          ,                  ?
 :   3 
     ,   ,   。
               。
         ,              ,               。
                  。
  :     ,    ,    ,        。
  :     。

12.       
using System;
class A
{
	public A()
	{
		PrintFields();
	}
	
	public virtual void PrintFields(){}
	}
	
	class B:A
	{
		int x=1;
		int y;
		public B()
		{
			y=-1;
		}
	public override void PrintFields()
	{
		Console.WriteLine("x={0},y={1}",x,y);
	}
}
   new B()  B    ,      ?
 :X=1,Y=0;x= 1 y = -1

13.        ?
 :                 。       。     。

14.CTS、CLS、CLR      ?
 :CTS:      。CLS:      。CLR:       。

15.        ?
 :               。             。

16.         ?
 :unsafe:     。   CLR  。

17.        ?
 :RTTI:      。

18.net             ?     ?
 :DataSet:     。
DataCommand:      。
DataAdapter:     ,    。

19.ASP.net          ?       ?
 :10。Windwos(  ) IIS...From(  )   ....Passport(  )

20.   Code-Behind  ?
 :    。

21. .net ,      ?
 :   。(    ,   ,  ,    )

22.     WebService      ?
 :1.  WSDL.exe     。
2.  VS.NET  Add Web Reference    

23..net Remoting         ?
 :                ,       ,        。

24. C# ,string str = null   string str = “”                  。 
 :string str = null           , string str = ""                 。

25.    dotnet  (class)   (struct)   ?
 :Class      ,      ,          ,Struct     ,          .

좋은 웹페이지 즐겨찾기