Empty: string STR =null, string STR = “”, string STR =string.empty.

String.Empty is a static constant of the String class; Empty: public static readOnly String Empty; String STR =null indicates that STR does not point to any object.

2. Can I use Pointers in C#? How to use it? C# does not support Pointers by default for type safety. That’s not to say that C# doesn’t support Pointers, though. Using the unsafe keyword, you can open up unsafe code development mode. In unsafe mode, we can manipulate memory directly so that we can use Pointers. In unsafe mode, the CLR does not detect the security of unsafe code, but executes it directly. Unsafe code requires developers to check for security.

3. What is the three-tier architecture?

The 3-Tier architecture divides the entire business application into: User Interface Layer, Business Logic Layer and Data Access Layer. The purpose of hierarchy differentiation is the idea of “high cohesion and low coupling”. In software architecture design, hierarchical structure is the most common and important one. The hierarchical structure recommended by Microsoft is generally divided into three layers, from bottom to top: data access layer, business logic layer (or domain layer), and presentation layer.

4. Can C# operate directly on memory?

C# can operate directly on memory. However, C# does not support pointer operations by default to keep type safety. However, by using the unsafe keyword, you can define unsafe contexts where Pointers can be used.

5. What is the difference between sleep() and wait() in multithreaded programming? Can Int DataTime be null?

Wait () and sleep() both interrupt() methods interrupt() and throw InterruptedException once the thread enters wait()/sleep()/join(). If the thread is running normally, it will not throw this exception. In actual coding, try.. Catch to safely terminate the thread. The difference between: 1) Wait () is an Object method, and sleep() is a Thread method. 2) Wait, notify, and notifyAll can only be used in synchronous control methods or blocks. Sleep can be used anywhere. Notify and notifyAll do not need to catch exceptions Datetime is struct, value type, value type cannot be null. Only Datetime generics express Datetime? The type can be assigned to null, but that’s just shorthand. DateTime? Nullable. All value types can be converted to this form to assign null

6.Short s1=1; s1=s1+1; What’s wrong with two lines of code? Please point out why? Describe the differences between UDP and TCP. Short s1 = 1; s1 = s1 + 1; Since 1 is an int, s1+1 is also an int and requires a cast to assign to short. Short s1 = 1; s1 += 1; It compiles correctly because s1+= 1; S1 = (short)(s1 + 1); There is an implicit cast. Differences between UDP and TCP: 1. TCP is connection-based and UDP is connectionless 2. Requirements on system resources (more TCP and less UDP) 3. UDP program structure is relatively simple 4. Stream pattern versus datagram pattern 5. TCP ensures data correctness, UDP may lose packets, TCP ensures data sequence, UDP does not

1 1 2 3 5 8 13 21 34…… Recursive algorithm to figure out what’s in the NTH place?

public static void main(String[] args) { System.out.println(cp(10)); } if public static int cp(int n){ if(n<=0){ return -1; } else if(n==1||n==2){ return 1; } else{ return cp(n-1)+cp(n-2); }}Copy the code

9. Write a bubble sort?

int temp = 0; int[] arr = {23, 44, 66, 76, 98, 11, 3, 9, 7}; for (int i = 0; i < arr.Length - 1; I ++) {#region moves large numbers to array arr.Length-1-i for (int j = 0; j < arr.Length - 1 - i; j++) { if (arr[j] > arr[j + 1]) { temp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = temp; }} console. WriteLine(" Sorted array: "); foreach (int item in arr) { Console.Write(item+""); } Console.WriteLine(); Console.ReadKey();Copy the code

10. What is the name of a hidden parameter in the SET accessor? What is code-behind technology? In ASP.NET, the separation of display logic and processing logic is realized through the method of ASPX page pointing to CS file, which is helpful for the creation of web applications. For example, the division of labor, art and programming can do each, no longer like the previous ASP code and HTML code mixed together, difficult to maintain.

11. Please briefly describe the differences and advantages between List and Dictionary

. List is a generic collection. Inside is the entity class. Can be instantiated. The dictionary function is relatively simple, and it is only a powerful array. The key-value pairs stored in it.
,v>

12. Describe the.NET MVC design pattern and how it works.

MVC is a program development and design pattern, which realizes the separation of display module and function module. It improves the maintainability, portability, extensibility and reusability of the program, and reduces the difficulty of developing the program. It is mainly divided into model, view, controller three layers. It is the main part of the application program, mainly including business logic module (Action, DAO class in the Web project) and data module (POJO class). The model is independent of the data format, so that a single model can provide data for multiple views. Because code applied to a model can be written once and reused by multiple views, The view is generally composed of JSP and HTML in the Web. 3. The controller receives the request from the interface and hands it to the model for processing

13. Describe the six built-in objects in asp.net and their usage. 1) Response (return the object to the client)

2) Request (Server receives data from client)

3) Server

4) Application (store public variables)

5) Session (stored on the server)

6) Cookies (stored on the client)

14. What’s the difference between Get and Post?

The parameters of the GET request are placed in the URL, and the parameters of the POST request are placed in the body. The LENGTH of URL parameters in GET requests is limited, while that in POST requests is not limited. The parameters of GET request can only be ASCII code, so Chinese requires URL encoding, while the parameters of POST request do not have this limitation.

15. Describe WebService technology and its use in the development process.

Create an empty Web application project (there is no Web service project in it…) 3. Create a Web service (ASMX)

16. What is SQL injection attack and how? The so-called SQL injection attack is that the attacker inserts SQL commands into the input field of a Web form or the query string of a page request to trick the server into executing malicious SQL commands. Forms in which user input is directly used to construct (or influence) dynamic SQL commands or as input parameters to stored procedures are particularly vulnerable to SQL injection attacks.

1. Replace single quotation marks. 2. Delete all hyphens in the user input. Limit the length of a form or query string 5. Check the validity of user input 6. Use stored procedures to execute all queries

17. Explain the difference between HTML and server controls.

1) The former can trigger events specific to server controls, while the latter can only trigger page-level events on the server by way of recursion. 2) Data entered into the former can be maintained between requests (that is, with state management capabilities), while the latter cannot automatically maintain data and can only be saved and restored using page-level scripts. 3) The former can automatically detect the browser and adjust to the appropriate display, while the latter has no auto-adaptation function and must manually detect the browser in the code. 4) Each server control has a set of properties that can change the look and behavior of the control in server-side code, while the latter only has HTML properties. When certain controls do not require server-side event or state management capabilities, you can improve application performance by choosing HTML controls. 18. How many ways do you know to pass values to a page in Asp.net? Please list them

What is the SoAP protocol?

SOAP is a protocol for accessing web services.

20. Describe the five ADO.NET objects? 3, DataAdapter (user-populated DataSet, disconnected mode) 4, DataReader (read database, a read-only mode, only forward) 5, DataSet (DataSet, It’s like computer memory.