ASP. NET interview materials [3]

Source: Internet
Author: User
A: const is used to declare constants during programming, and readonly is used to declare the runtime constant.
What are the differences between UDP and TCP connections?
A: TCP is a transmission control protocol that provides connection-oriented and reliable byte stream services. When users and servers exchange data with each other, data can be transmitted only after a TCP connection is established before data interaction. TCP provides the time-out redial function to verify data.
UDP is a User Datagram Protocol, a simple datagram-oriented transmission protocol, and an unreliable connection.
How Should processes and threads be understood separately?
A: The process is larger than the thread. Program The running units are all system running units that the operating system understands. A program must have at least one process and at least one thread in one process, the thread division scale is smaller than that of the process. The process has independent memory units and the thread is shared memory, this greatly improves the program running efficiency. multiple threads in the same process can be executed concurrently.
What is the base class of all classes in. Net?
A: object.
Can I use foreach to traverse the accessed object?
A: You need to implement the ienumerable interface and the getenumerator () method.
What is the difference between heap and stack?
A: heap is a heap, and space is allocated and released by manual operations. It has a large free storage zone.
The stack is automatically allocated and released by the operating system, and the space on the stack is limited. During compilation, both the variable and function allocation memory are on the stack, and the parameter transfer during function calling is also on the stack.
Traverse all textbox controls on the page and assign it a string. Empty?
A: foreach (system. Windows. Forms. 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;
}
}
Program a bubble sort. Algorithm ?
A: 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;
}
}
}
Evaluate the values of the following expressions and write out one or more implementation methods: 1-2 + 3-4 + ...... + M
A: 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 ();
What is an application domain?
A: The application domain can be considered as a lightweight process. Security. Small resource occupation.
What is regulated Code ?
A: unsafe: unmanaged code. Does not run through CLR.
In. net, what does the accessory mean?
A: assembly. (Intermediate language, source data, resources, assembly list)
What are common WebService call methods?
A: 1.use the wsdl.exe command line tool.
2. Use the Add web reference menu option in vs. net
What is the working principle of. Net remoting?
A: the server sends a process number and a program domain number to the client to determine the object location.
Based on the knowledge of thread security, analyze the following code. Will a deadlock occur when I> 10 is used to call the test method? And briefly explain the reasons.
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)
This article briefly introduces your understanding of the remoting and WebService technologies under the Microsoft. NET Framework and their practical applications.
A: Ws uses http to penetrate the firewall. Remoting can improve the efficiency by using TCP/IP and binary transmission.
Remoting is. net is used to call methods across machine, process, and appdomain. For a three-structure program, remoting technology can be used to construct the program. it is the basic technology for distributed applications. it is equivalent to the previous DCOM.
Web Service is a common model for building applications and can be implemented on all operating systems that support Internet communication. Web service enables the combination of component-based development and web to achieve the best, component-based object model.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.