1. in C #, use text or images to describe the differences between string STR = NULL and string STR =.
Key answer: Describe the detailed space allocation. (10 points)
A: String STR = NULL indicates that no memory space is allocated to it, while string STR = "" indicates that it is allocated with a memory space of a null string.
2. Describe the similarities and differences between classes and struct in DOTNET: (10 points)
A: The class can be instantiated. It belongs to the reference type and is allocated to the memory stack. struct belongs to the value type and is allocated to the memory stack.
3. Based on the delegate knowledge, complete the following code snippets in the user control: (10)
Namespace Test
{
Public Delegate void ondboperate ();
Public class usercontrolbase: system. Windows. Forms. usercontrol
{
Public event ondboperate onnew;
Privatevoidtoolbar_buttonclick (objectsender, system. Windows. Forms. toolbarbuttonclickeventargs E)
{
If (E. Button. Equals (btnnew ))
{
// Complete the following code to call the onnew event of the ondboperate delegate signature.
}
}
}
A: If (onnew! = NULL
Onnew (this, E;
4. Analyze the following code to complete the blanks (10 points)
String strtmp = "abcdefg ";
Int I = system. Text. encoding. Default. getbytes (strtmp). length;
Int J = strtmp. length;
After the above code is executed, I = J =
Answer: I = 13, j = 10
5. In the sqlserver server, there are two field IDs and lastupdatedate in the given table 1. The ID indicates the updated transaction number, and the lastupdatedate indicates the server time during the update, use an SQL statement to obtain the last updated transaction number. (10)
A: Select ID
From Table1
Where lastupdatedate = (select max (lastupdatedate) from Table1)
6. Based on the knowledge of thread security, analyze the following code. Will the deadlock occur when I> 10 is called when the test method is called? And briefly explain the reasons. (10 points)
Public void test (int I)
{
Lock (this)
{
If (I> 10)
{
I --;
Test (I );
}
}
}
A: No deadlock will occur (but one int is passed by value, so each change is only a copy, so no deadlock will occur. But if you replace int with an object, the deadlock will occur)
7. Analyze the following code. (10)
Public static void test (string connectstring)
{
System. Data. oledb. oledbconnection conn = new system. Data. oledb. oledbconnection ();
Conn. connectionstring = connectstring;
Try
{
Conn. open ();
.......
} Catch (exception ex)
{
MessageBox. Show (ex. tostring ());
} Finally
{
If (! Conn. state. Equals (connectionstate. Closed ))
Conn. Close ();
}
Excuse me
1) Can the above Code correctly use the connection pool?
Answer: If the input connectionstring is the same, you can use the connection pool correctly. But exactly the same means that the numbers of spaces in the hyphen are in the same order.
2) can all exceptions in the test method be captured and displayed in the exception handling method used by the above Code?
A: You can only catch exceptions in database connections. (In finally, catch, if there are other operations that may cause exceptions, try and catch should also be used. So theoretically not all exceptions will be caught .)
8. Briefly discuss your understanding of the remoting and WebService technologies under the Microsoft. NET architecture and their practical applications. (10)
A: Ws uses http to penetrate the firewall. Remoting can improve the efficiency by using TCP/IP and binary transmission.
9. The company requires the development of an inheritance system. windows. forms. listview components require the following special features: When you click the headers of columns in the listview, all rows in the view can be rearranged based on the values of each row in the click column (the sorting method is similar to that in the DataGrid ). Based on your knowledge, please briefly discuss your ideas: (10)
A: Based on the column header clicked, the ID of this column is taken out, sorted by the ID, and bound to the listview
10. Specify the following XML file to complete the algorithm flowchart. (10)
<Filesystem>
<Driverc>
<Dir dirname = "msdos622">
<File filename = "command.com"> </File>
</Dir>
<File filename = "msdos. sys"> </File>
<File filename = "Io. sys"> </File>
</Driverc>
</Filesystem>
Draw a flowchart that traverses all file names (filename) (use recursive algorithms ).
A:
Void findfile (Directory D
{
Fileorfolders = D. getfileorfolders ();
Foreach (fileorfolder fof in fileorfolders
{
If (FoF is File
You found a file;
Else if (FoF is directory
Findfile (FoF;
}
}
Simply put, the system traverses the root node and finds the child node.
11. Net layer-3 structure.
Data access layer, business layer, and presentation layer (may be called differently)
12. Net Value Object.
The. NET public type system CTS can be divided into two categories: the reference type and the value type. The reference type is allocated to the heap, and the value type is allocated to the stack;
We generally do not call a value-type variable or constant as an object. The question is actually called a value object. It can be seen that the person with the question is not clear in concept; in design, the concept of an object is accompanied by a class. an instance of a class is called an object.
13. There are several methods to call the status of another page on one page.
If it is a method, you can declare it as a public or public static method or variable, or you can set it to get attributes.
14. What is the difference between session and application.
Sessions are sessions and multithreading. Applications are globally unique and their operations involve synchronization issues.
In a simple example, an application (such as your website) is a chat room, and a session (active user accessing the site) is a person in it,
15. How to prevent a class from being new.
Declare the class constructor as private. At the same time, you can provide a public static class name getinstance () function to construct the class instance.
16. What is the difference between prerender and event?
Prerender is
The event handler receives an eventargs type parameter.
Remarks
Use this event to execute any updates before the Server Control displays the page output. During the lifetime of the event, you can save any changes to the server control view status. Do not save the same changes made during the rendering phase.
------------------------
That is, the processing to be performed when the control is output to the client.
17. What are the main object-oriented ideas?
Three main features of object-oriented: inheritance, encapsulation, and polymorphism. The idea of facial object is not just a sentence or a sentence. The main idea is to reduce code duplication and increase the code reuse rate ..
18. What is a user control in Asp.net?
The question is generally confusing to you. this is because the new user still cannot clearly identify the user control and Server Control (also called custom control ).. the user control is generally used when the content is mostly static or slightly changed .. it is relatively large .. similar to include... in ASP .. but more powerful functions ..
19. What is an application domain? What is regulated code? What is a strong system? What is packing and unpacking? What is overload? What are the explanations of CTS, CLS, and CLR?
This must be described at the moment. There are too many things... too many typing to be killed... Let's just find a simple example!
CTS: common type system, mainly for standardization between languages.
CLS: The minimum standard group that ensures code access in any language
CLR: when running in a common language, it mainly manages code, processes, loads code, and Code of all services.
20. List the XML technologies you know and their applications.
XML is used for configuration and is used to save static data types. Web Services... And config are the most exposed to XML.
21. What is the difference between the value type and the reference type? Write the sample code of C.
The value type is stored in the memory, and the reference type is to save a copy in the memory. You can have multiple referenced objects in the memory .. but there is always only one value type.
The most common value types are static and struct;
For example:
Static int AA = 1; // Value Type
If multiple users change the value of AA, the value of AA will be based on the last modification record. other users' modifications will be washed away.
The reference type, which best illustrates the problem, is instantiation. The new object is allocated with an independent memory. So the values do not conflict with each other/
What are common objects in 22.ado.net? Describe them separately.
Connection database connection object
Command database commands
Datareader data reader
Dataset
23. How to understand delegation?
The concept of delegation is best described as an event. because the event uses a delegate. example: This. load + = new system. eventhandler (this. page_load); this is a delegate.
For specific usage, refer to. My previous post to design CAT/mouse interaction ..
What are the similarities and differences between interfaces and classes in 24. C.
Class is the implementation and set of method functions, and the interface is the constraint class.
What classes are used to read and write databases in 25.net? Their role
See question 6. The answer is similar.
26. Similarities and Differences between UDP and TCP connections.
This is not clear.
What are the authentication methods for 27.asp.net? What are their principles?
Window verification: Enable the window account for each user to verify his/her identity. High security.
Forms authentication: Write an authentication ticket for each login user. The most widely used authentication method on the Web... flexible and convenient.
28. How do processes and threads understand each other?
This is the most confusing thing for new people ..
Process: Process
29. What is code-behind technology.
Create a project under vs. Net... Have you seen files with three suffixes: aspx, resx, and CS ?? This is code separation. HTML code and server code are separated to facilitate code compilation and arrangement.
30. Role of the Active Directory.
The Active Directory is the most important function of window2000. It can integrate all user information and access multiple different network services after login.
View post: http://www.ies.impu.edu.cn/resource/ OS /windowsx/WindowsGeneral/WinGeneral0008.htm
In 31..net, what namespaces do classes that read and write XML belong?
System. xml class
32. Explain the significance and functions of UDDI and WSDL.
I cannot explain it clearly... it's another big piece ..
33. What is soap and what applications are there.
Simple Object Access protocal, simple object protocol. A standard that uses XML as the basic encoding structure and is built on existing communication protocols (such as HTTP, But Ms is said to be engaged in soap with the lowest layer architecture on TCP/IP ).
Is the protocol used by the Web Service vigorously promoted by Microsoft ..
34. How to deploy an Asp.net page.
I don't know what it means... if you have to answer this question, write a suffix file with. aspx... then install IIS and the framework environment... just browse.
35. How to understand the garbage collection mechanism in. net.
The garbage collection system is as follows:
If the memory is not enough, the garbage collector takes all the objects as invalid objects (recycled objects), and then takes the global variables, static, and local variables in the active state, and put the object pointed to by the current CG pointer into a table. then
The system searches for objects in the new list and adds them to the list. Other objects not included in the list will be recycled.
36. What are common WebService call methods?
I usually use WSDL... or web reference ..
In 37..net, what namespaces do classes that read and write XML belong?
System. xml class
38. Explain the significance and functions of UDDI and WSDL.
I cannot explain it clearly... it's another big piece ..
39. What is soap and what applications are there.
Simple Object Access protocal, simple object protocol. A standard that uses XML as the basic encoding structure and is built on existing communication protocols (such as HTTP, But Ms is said to be engaged in soap with the lowest layer architecture on TCP/IP ).
Is the protocol used by the Web Service vigorously promoted by Microsoft ..
40. How to deploy an Asp.net page.
I don't know what it means... if you have to answer this question, write a suffix file with. aspx... then install IIS and the framework environment... just browse.
41. How to understand the garbage collection mechanism in. net.
The garbage collection system is as follows:
If the memory is not enough, the garbage collector takes all the objects as invalid objects (recycled objects), and then takes the global variables, static, and local variables in the active state, and put the object pointed to by the current CG pointer into a table. then
The system searches for objects in the new list and adds them to the list. Other objects not included in the list will be recycled.
42. What are common WebService call methods?
I usually use WSDL... or web reference ..