c#.net面试题。等答案
Part 1:C# Questions(3*10)
1) The C# keyword .int. maps to which .NET type?
(A).System.Int16
(B).System.Int32
(C).System.Int64
(D).System.Int128
2) Which of these string definitions will prevent escaping on backslashes in C#?
(A).string s = #.n Test string.;
(B).string s = ..n Test string.;
(C).string s = @.n Test string.;
(D).string s = .n Test string.;
3) Which of these statements correctly declares a two-dimensional array in C#?
(A).int[,] myArray;
(B).int[][] myArray;
(C).int[2] myArray;
(D).System.Array[2] myArray;
4) If a method is marked as protected internal who can access it?
(A).Classes that are both in the same assembly and derived from the declaring class.
(B).Only methods that are in the same class as the method in question.
(C).Internal methods can be only be called using reflection.
(D).Classes within the same assembly, and classes derived from the declaring class.
5) What is boxing?
(A). Encapsulating an object in a value type.
(B). Encapsulating a copy of an object in a value type.
(C). Encapsulating a value type in an object.
(D). Encapsulating a copy of a value type in an object.
6) What compiler switch creates an xml file from the xml comments in the files in an assembly?
(A)./text
(B)./doc
(C)./xml
(D)./help
7) What is a delegate?
(A).A strongly typed function pointer.
(B).A light weight thread or process that can call a single method.
(C).A reference to an object in a different process.
(D).An inter-process message channel.
8) How does assembly versioning in .NET prevent DLL Hell?
(A).The runtime checks to see that only one version of an assembly is on the machine at any one time.
(B)..NET allows assemblies to specify the name AND the version of any assemblies they need to run.
(C).The compiler offers compile time checking for backward compatibility.
(D).It doesn.t.
9) In the NUnit test framework, which attribute must adorn a test class in order for it to be picked up by the NUnit GUI?
(A).TestAttribute
(B).TestClassAttribute
(C).TestFixtureAttribute
(D).NUnitTestClassAttribute
10) Which of the following operations can you NOT perform on an ADO.NET DataSet?
(A).A DataSet can be synchronised with the database.
(B).A DataSet can be synchronised with a RecordSet.
(C).A DataSet can be converted to XML.
(D).You can infer the schema from a DataSet.
Part 2:ASP.NET Questions
1. When was ASP.NET released?
2. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
3. What methods are fired during the page load?
4. What namespace does the Web page belong in the .NET Framework class hierarchy?
5. Where do you store the information about the user’s locale?
6. What’s a bubbled event?
7. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
8. Explain the differences between Server-side and Client-side code?
9. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
10. What is the Global.asax used for?
11. What are the Application_Start and Session_Start subroutines used for?
12. Whats an assembly?
13. Explain what a diffgram is, and a good use for one?
14. Whats MSIL, and why should my developers need an appreciation of it if at all?
15. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
16. What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
17. What base class do all Web Forms inherit from?
18. Name two properties common in every validation control?
19. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
20. How many classes can a single .NET DLL contain?