Asp. NET common face questions and answers (130 questions)

Source: Internet
Author: User
Tags bitwise closing tag soap

1. C # The difference between property and attribute (pumping Class), what are their uses, and what are the benefits of this mechanism?
A: Property and attribute Chinese are all called attributes. property, however, refers to the data region that the class provides outward. attribute is a description of the object at compile time or runtime property. There is an essential difference between the two.
2. Lists several ways to pass values between ASP.
A. 1). Use querystring, such as ... id=1; Response. Redirect () ....
2). Use the session variable
3). Use Server.Transfer
3. The rules for a number of columns are as follows: 1, 1, 2, 3, 5, 8, 13, 21, 34 ... The 30th digit is the number, which is realized by recursive algorithm.
Answer: 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);
}
}
What are the delegates in 4.c#? Is the event a delegate? ()
For:
A delegate can substitute a method as a parameter into another method.
A delegate can be understood as a reference to a function.
Yes, it's a special kind of delegate.
The difference between 5.override and overloading
Answer: The difference between override and overload. Overloading is the same as the name of the method. Unlike parameters or parameter types, multiple overloads are made to accommodate different needs, and override is a function rewrite in the base class. In order to adapt to the need.
6. If you need to pass variable values in a B/s structure, but you cannot use session, Cookie, application, how many methods do you handle?
Answer: this. Server.Transfer
7. Please programmatically traverse all TextBox controls on the page and assign it a value of String.Empty?
For:
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. Do you programmatically implement a bubbling sorting algorithm?
For:
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. Describe the implementation of indexers in C #, and can they only be indexed by numbers?
Answer: No. Any type can be used.
10. Ask for the value of the expression below and write down one or more of the implementations you think of: 1-2+3-4+......+m
For:
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 ();
12. In the following example
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);
}
What output is generated when you use new B () to create an instance of B?
Answer: x=1,y=0;x= 1 Y = 1
13. What is an application domain?
A: An application domain can be understood as a lightweight process. Play a safe role. Low resource footprint
What are the 14.CTS, CLS, and CLR explanations for each?
A: CTS: a common language system. CLS: Common Language Specification. CLR: Common language runtime.
15. What are crates and unboxing?
A: Converting from a value type interface to a reference type boxing. Converting from a reference type to a value type unboxing.
16. What is a regulated code?
Answer: unsafe: Unmanaged code. Not run through the CLR.
17. What is a strongly typed system?
Answer: RTTI: type identification System.
What classes are needed to read and write databases in 18.net? Their role?
Answer: DataSet: Data memory.
DataCommand: Executes the statement command.
DataAdapter: The collection of data, the term padding.
21. In. NET, what does the accessory mean?
Answer: Assembly. (intermediate language, source data, resources, assembly list)
22. What are the common methods of calling WebService?
Answer: 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 23..net Remoting?
A: The server sends a process number to the client, a program field number to determine the location of the object.
29. Based on the knowledge of thread safety, analyze the following code to see if the test method will cause a deadlock when i>10 is called? and briefly explain the reason.
public void Test (int i)
{
Lock (This)
{
if (i>10)
{
I –
Test (i);
}
}
}
A: There is no deadlock, but a bit of int is passed by value, so each change is just a copy, so there is no deadlock. But if you change int into an object, the deadlock will happen.)
30. Briefly discuss your understanding of the two technologies of remoting and webservice under the Microsoft. NET Framework and the practical applications.
A: WS is primarily available with HTTP, penetrating firewalls. and remoting can use TCP/IP, binary delivery to improve efficiency.
Remoting is a technique used in. NET to make method calls across machine, process, and AppDomain, and for a 30%-structured program, it can be built using remoting technology. It is the basic technology for distributed applications. The equivalent of the previous DCOM Web service is a common model for building applications and can be implemented on all operating systems that support Internet network communication. Web Service enables component-based development and the combination of the web to achieve the best, component-based object model
31. The company requires the development of a component that inherits the System.Windows.Forms.ListView class, which requires the following special features: When you click a ListView column header, you can rearrange all the rows in the view by clicking each row of rows in the column ( Sort the same way as a DataGrid). According to your knowledge, please briefly talk about your ideas
A: Depending on the column header of the click, the ID of the package is taken out, sorted by that ID, and then bound to the ListView.
32. Given the following XML file, complete the algorithm flowchart.
<FileSystem>
< DRIVERC >
<dir dirname= "msdos622″>
<file FileName = "Command.com" ></File>
</Dir>
<file FileName = "MSDOS. SYS "></File>
<file FileName = "IO. SYS "></File>
</DriverC>
</FileSystem>
Please draw a flowchart that iterates through all filenames (using the recursive algorithm).
For:
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);
}
}
35. Objects that can be accessed with a foreach traversal need to implement the ________________ interface or declare the type of the ________________ method.
Answer: IEnumerable, GetEnumerator.
What is 36.GC? Why do you have a GC?
A: The GC is a garbage collector. Programmers don't have to worry about memory management because the garbage collector is automatically managed. To request garbage collection, you can call one of the following methods:
System.GC ()
Runtime.getruntime (). GC ()
37.String s = new string ("XYZ"); several string Object created?
A: Two objects, one is "XyX", and the other is a reference to "XyX" like S.
What is the difference between 38.abstract class and interface?
For:
A class that declares the existence of a method and does not implement it is called the extraction class (abstract class), which is used to create a class that embodies some basic behavior, declares a method for that class, but does not implement the class in that class. An instance of the abstract class cannot be created. However, you can create a variable whose type is a drawing class and point it to an instance of a specific subclass. You cannot have a smoke-like constructor or a static method of pumping. The subclasses of the Abstract class provide implementations for all the extraction methods in their parent class, otherwise they are also smoke-like classes. Instead, implement the method in the subclass. Other classes that know their behavior can implement these methods in the class.
Interface (interface) is a variant of the extraction class. In an interface, all methods are drawn. Multiple inheritance can be obtained by implementing such an interface. All the methods in the interface are drawn, none of them have a program body. An interface can only define static final member variables. The implementation of an interface is similar to a subclass, except that the implementation class cannot inherit the behavior from the interface definition. When a class implements a special interface, it defines the method (which is given by the program body) to all such interfaces. It can then invoke the interface on any image of the class that implements the interface. Because of the extraction class, it allows you to use the interface name as the type of the reference variable. The usual dynamic binder will take effect. A reference can be converted to an interface type or converted from an interface type, and the instanceof operator can be used to determine whether the class of an object implements an interface.

39. Start a thread with run () or start ()?
A: Starting a thread is calling the start () method so that the virtual processor represented by the thread is in a running state, which means it can be dispatched and executed by the JVM. This does not mean that the thread will run immediately. The run () method can produce a flag that must be exited to stop a thread.

40. Can interfaces be inherited by an interface? is the pump class achievable (implements) interface? Can the extraction class inherit entity classes (concrete Class)?
A: An interface can inherit an interface. The pumping class can implement the (implements) interface, and the extraction class will inherit the entity class, but only if the entity class must have a definite constructor.
41. Can the constructor constructor be override?
A: The constructor constructor cannot be inherited, so overriding cannot be overridden, but it can be overloaded with overloading.

42. Can I inherit the String class?
A: The string class is the final class and cannot be inherited.

44. Two pairs of image values are the same (x.equals (y) = = true), but can have different hash code, this sentence right?
Answer: No, there is the same hash code.

Does 45.swtich work on a byte, can it function on a long, or does it work on a string?
A: in switch (EXPR1), Expr1 is an integer, character, or string, so it can function on byte and long, or on string.
47. When a thread enters an synchronized method of an object, does the other thread have access to other methods of this object?
No, an synchronized method of an object can only be accessed by one thread.

Whether the 48.abstract method can be static at the same time, whether it can be native at the same time, can it be synchronized at the same time?
Answer: No.
49.List, Set, does the map inherit from the collection interface?
A: List,set is map is not

The elements in 50.Set cannot be duplicated, so what is the way to distinguish between duplicates or not? Are you using = = or equals ()? What is the difference between them?
A: The elements in set cannot be duplicated, so use the iterator () method to distinguish between duplicates or not. Equals () is the interpretation of two sets for equality.
The Equals () and = = methods Determine whether the reference value points to the same pair as equals () is overwritten in the class so that when the contents and types of the two detached objects match, the truth is returned.

51. Does the array have the length () method? Does string have the length () method?
A: Neither array nor string has the length () method, only the length property.

What is the difference between 52.sleep () and wait ()?
Answer: The sleep () method suspends the current thread for a specified time.
Wait () frees the lock on the object and blocks the current thread until it acquires the lock again.

53.short S1 = 1; S1 = s1 + 1; what's wrong? Short S1 = 1; S1 + = 1; what's wrong?
Answer: short S1 = 1; S1 = s1 + 1; error, S1 is a short type, s1+1 is an int type, cannot be converted to short type explicitly. Can be modified to S1 = (short) (S1 + 1). Short S1 = 1; S1 + = 1 correct.

54. Talk about final, finally, finalize the difference.
For:
final-modifier (keyword) If a class is declared final, it means that it can no longer derive a new subclass and cannot be inherited as a parent class. Therefore, a class cannot be declared abstract and declared final. Declaring variables or methods as final ensures that they are not changed in use. A variable declared as final must be given an initial value at the time of declaration, and can only be read in subsequent references and cannot be modified. A method that is declared final can also be used only and cannot be overloaded
Finally-provides a finally block to perform any cleanup operations when the exception is processed. If an exception is thrown, the matching catch clause executes, and the control enters the finally block, if any.
The finalize-method name. Java technology allows the use of the Finalize () method to do the cleanup necessary before the garbage collector clears the image out of memory. This method is called by the garbage collector to this object when it determines that the object is not referenced. It is defined in the Object class, so all classes inherit it. Subclasses override the Finalize () method to organize system resources or perform other cleanup work. The Finalize () method is called on the object before the garbage collector deletes the image.

55. How to handle hundreds of thousands of concurrent data?
A: Use a stored procedure or transaction. Update at the same time when the maximum identity is obtained. Note that the primary key is not self-incrementing when this method is concurrent and there is no duplicate primary key. Get the maximum identity you want to have a stored procedure to get.

56.Session What are the major bugs that Microsoft has proposed to solve?
A: IIS because of the process recycling mechanism, the system is busy session will be lost, you can use Sate server or SQL Server database to store the session but this way is slower, and can not capture the end event of the session.

57. What is the difference between a process and a thread?
A: The process is the system for resource allocation and scheduling units, the thread is the CPU scheduling and dispatch units, a process can have multiple threads, these threads share the resources of this process.

58. What is the difference between heap and stack?
A: Stacks are allocated memory space during compilation, so your code must have a clear definition of the size of the stack, a heap is a dynamically allocated memory space during the program's run, and you can determine the size of the heap memory to allocate depending on how the program is running
59. member variables and member functions before adding static function?
A: They are called constant member variables and constant member functions, also known as Class member variables and class member functions. To reflect the state of the class, respectively. For example, a class member variable can be used to count the number of instances of a class, and the class member function is responsible for this statistical action.

60.ASP. NET compared with ASP, what is the main progress?
A: ASP interpretation form, aspx compiler type, performance improvement, can be separated from the work of art, more conducive to team development.

61. Produce an int array with a length of 100, and randomly insert 1-100 into it, and cannot be duplicated.
Int[] Intarr=new int[100];
ArrayList mylist=new ArrayList ();
Random rnd=new random ();
while (mylist.count<100)
{
int Num=rnd. Next (1,101);
if (!mylist.contains (num))
Mylist.add (num);
}
for (int i=0;i<100;i++)
intarr[i]= (int) mylist[i];

62. Describe the methods used to pass parameters between pages in. NET and say their pros and cons.
Answer: Session (ViewState) simple, but easy to lose
Application Global
Cookies are simple, but may not be supported, may be forged
Input ttype= "hidden" is simple and may be forged
URL parameter is simple, display in the address bar, the length is limited
The database is stable and secure, but the performance is relatively weak

63. Please indicate what the GAC means?
Answer: The global assembly cache.

64. How many ways are there to send requests to the server?
Answer: Get,post. Get is generally linked, post is usually button mode.

What is the difference between 65.DataReader and dataset?
A: One is a forward-only read-only cursor, and the other is an in-memory table.

66. How many stages does the software development process typically have? The role of each stage?
Answer: Requirements analysis, architecture design, code writing, QA, deployment

67. What is the meaning of the two keywords using and new in C #, please write the meaning you know? The using directive and the statement new Create instance new to hide the methods in the base class.
A: Using introduces namespaces or uses unmanaged resources
New instance or hide parent method

68. You need to implement the processing of a string, first of all, the string is removed, if there are contiguous spaces in the middle of the string, only one space is allowed, that is, allow more than one space in the middle of the string, but the number of consecutive spaces must not exceed a single.
Answer: String inputstr= "xx xx";
Inputstr=regex.replace (Inputstr.trim (), "*", "");

69. What does the following code output? Why?
int i=5;
int j=5;
if (Object.referenceequals (I,J))
Console.WriteLine ("Equal");
Else
Console.WriteLine ("Not Equal");
Answer: Not equal, because the comparison is to the image
70. What is SQL injection and how do I prevent it? Please illustrate.
A: The use of SQL language vulnerability to obtain a legal identity landing system. Programs such as authentication are designed to:
SqlCommand com=new SqlCommand ("SELECT * from Users where username= '" +t_name.text+ "' and pwd= '" +t_pwd.text+ "'");
Object obj=com. Excutescale ();
if (obj!=null)
{
by verifying
}
This code is easily injected into SQL. If the user in T_name input, enter in t_pwd 1′and 1 = ' 1 can enter the system.
71. What is reflection?
Answer: Dynamically Get assembly information
72. How to write design patterns with Singleton
Answer: The static property inside new, constructor private
73. What is Application Pool?
A: Web apps, like the thread Pool, improve concurrency performance.
74. What is a virtual function? What is a pump function?
A: virtual function: A function that can be inherited and overridden by a subclass. Image function: A function that specifies that its non-virtual subclasses must be implemented must be overridden.
75. What is XML?
Answer: XML expands Markup Language. Extensible Markup Language. Tags are information symbols that can be understood by computers, which can be used to process articles that contain various kinds of information between computers. How to define these tags, that is, you can choose International markup language, such as HTML, can also be used as XML, such as the freedom of the relevant people to decide the markup language, which is the extensibility of language. XML is simplified and modified from SGML. It mainly uses XML, XSL, XPath, and so on.
77. What is a user control in ASP.
A: User controls are typically used in situations where the content is static or a little bit changed. The use of the relatively large. Similar to the Include in asp: But the features are much more powerful.

78. List the XML technologies you know and their applications
A: XML is used for configuration to hold static data types. The most exposed XML is Web Services. and config

What are the objects commonly used in 79.ado.net? Describe it separately.
Answer: Connection database connection to the image
Command Database commands
DataReader Data reader
DataSet Data Set

80. What is Code-behind technology?
A: Aspx,resx and CS Three suffix file, this is code separation. Implements HTML code and server code separation. Easy code writing and collation.

81. What is soap and what are the applications?
A: SOAP (Simple Object access Protocol) is an XML-based protocol that is a protocol for exchanging information and executing remote procedure calls in a decentralized or distributed environment. Using SOAP, regardless of any particular transport protocol (the most common or HTTP protocol), allows any type of object or code to communicate with each other, on any platform, in any language. This mutual communication takes the form of XML-formatted messages.

Soap, also known as XMLP, provides a standard working mechanism for exchanging information for two of programs. It is entirely necessary to establish appropriate standards for this purpose in the context of electronic collaboration among various institutions.

Soap describes how a message is bundled into XML. It also explains the sender of the message, the content and address of the message, and when the message was sent. SOAP is the basic Communication protocol for Web service. The SOAP specification also defines how to use XML to describe program data and how to execute RPC (Remote Procedure call). Most SOAP solutions support rpc-style applications. SOAP also supports Document-style applications (SOAP messages contain only XML text information).

Finally, the SOAP specification also defines how the HTTP message transmits the SOAP message. MSMQ, SMTP, and TCP/IP can all be soap-capable transport protocols.

SOAP is a lightweight protocol for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technology to define an extensible message processing framework that provides a message structure that can be exchanged through a variety of underlying protocols. This framework is designed to be independent of the semantics of any particular programming model and other specific implementations.


SOAP defines a method to transfer an XML message from point A to point B. To do this, it provides an XML-based message processing framework with the following characteristics: 1) extensible, 2) can be used through a variety of underlying network protocols, 3) independent of the programming model.

The difference between property and attribute in 82.c#, what is their usefulness, and where is the benefit of this mechanism?
A: One is a property, a field for accessing a class, one is an attribute, an additional property used to identify a class, a method, etc.

The main difference between 83.XML and HTML
Answer: 1. XML is case-sensitive, and HTML is not distinguished.
2. In HTML, if the context clearly shows where the paragraph or list key ends, you can omit the end tag such as </p> or </li>. In XML, you must never omit the end tag.
3. In XML, an element that has a single tag without a matching closing tag must end with A/character. This way the parser knows not to look for the end tag.
4. In XML, attribute values must be enclosed in quotation marks. In HTML, the quotation marks are available for use.
5. In HTML, you can have a property name without a value. In XML, all attributes must have corresponding values.

What is the ternary operator in 84.c#?
For:? :。

85. When integer A is assigned to an object pair image, the integer a will be
Answer: Boxing.

86. Does the class member have an accessible form of _____?
Answer: this.; New Class (). Method;

87.public static const int a=1; Is this code wrong? What is it?
A: const cannot be modified with static.

88.float f=-123.567f; The value of int i= (int) f;i is now _____?
Answer:-123.

89. What is the keyword of the delegate declaration?
Answer: Delegate.
91. All custom user controls that are in ASP. NET must inherit from ________?
Answer: Control.
92. All serializable classes in. NET are marked as _____?
Answer: [Serializable]
93. We don't have to worry about memory leaks in. NET managed code, because we have ___?
Answer: GC.
94. Are there any errors in the following code? _______
Using System;
Class A
{
public virtual void F () {
Console.WriteLine ("A.F");
}
}
Abstract class B:a
{
Public abstract override void F (); A: Abstract override is not to be modified together.
}//new public abstract void F ();
95. When the class T only declares the private instance constructor, then outside of the program text of T, ___ can derive a new class from T, either ___ (or not), and no instance of T can be created directly by ____ (or not).
A: No, it's not possible.
96. Is there an error in the following code?
switch (i) {
Case (): Answer://case () condition cannot be empty
Casezero ();
Break
Case 1:
Caseone ();
Break
Case 2:
Dufault; Answer://wrong, format is not correct
Casetwo ();
Break
}

97. In. NET, can a class System.Web.UI.Page be inherited?
Answer: Yes.

What is the error handling mechanism of 98..net?
A: the. NET error handling mechanism uses the try->catch->finally structure, and when an error occurs, it is thrown on the layer until a matching catch is found.

99. What is wrong with operator statement and only declaring = =?
A: Do you want to modify both Equale and Gethash ()? "=" must be overloaded with "! =" overloaded
104. A password uses only K, L, M, N, o a total of 5 letters, the words in the password are arranged from left to right, the password Word must follow the following rules:
(1) The minimum length of a password word is two letters, can be the same, can also be different
(2) K cannot be the first letter of a word
(3) If L appears, the number of occurrences occurs more than once
(4) m cannot make the last one or the second-lowest letter
(5) k appears, then n must appear
(6) O if it is the last letter, L must appear
Question one: Which of the following letters can be placed behind O in the Lo to form a 3-letter password word?
A) K B) L C) M D) N
Answer: B

Question two: If you can get the letter is K, L, M, then can form a two-letter long password word number of how many?
A) 1 B) 3 C) 6 D) 9
Answer: A
Question three: Which of the following is the word password?
A) Klln B) loml C) Mllo D) Nmko
Answer: C
8.62-63=1 equation does not hold, please move a number (can not move minus and equal sign), so that the equation is set up, how to move?
Answer: 62 moved to 2 of the 6-time Square
105. For one of these enumeration types:
Enum Color:byte
{
Red,
Green,
Blue,
Orange
}
Answer: string[] Ss=enum.getnames (typeof (Color));
Byte[] Bb=enum.getvalues (typeof (Color));

106. The difference between property and attribute in C #, what are their uses, and what are the benefits of such a mechanism?
A: attribute: The base class for custom attributes; property: Properties in a class

107.c# can the memory be directly manipulated?
A: Under. NET,. NET references the garbage collection (GC) feature, which replaces the programmer however, in C #, you cannot directly implement the Finalize method, but instead call the base class's Finalize () method in a destructor
108.ADO. What are some of the major improvements in net versus ADO?
A: 1:ado.net does not rely on OLE DB providers, but instead uses. NET managed programs, 2: Do not use COM3: Do not support dynamic cursors and server-side Tour 4:, you can disconnect connection and keep the current dataset available 5: Strongly type conversion 6:xml support
109. Write an HTML page, to achieve the following functions, left click on the page to display "Hello", right click on the display "No right button." and automatically closes the page after 2 minutes.
Answer: <script ***script>
SetTimeout (' Window.close (); ', 3000);
Function Show ()
{
if (Window.event.button = = 1)
{
Alert ("left");
}
else if (Window.event.button = = 2)
{
Alert ("right");
}
}
</script>
110. Probably describe the ASP. NET server control's life cycle
A: Initialize load view state processing postback data load send postback change notification handle postback event pre-render save state rendering disposition Uninstall
111.Anonymous Inner Class (anonymous inner Class) can extends (inherit) other classes, is it possible to implements (implement) interface (interface)?
Answer: No, interface can be implemented
112.Static Nested class and Inner class, the more you say the better
A: The static Nested class is an inner class that is declared static (static), and it can be instantiated without relying on an external class instance. The usual inner classes need to be instantiated after the external class is instanced.
The difference between 113.,& and &&.
& is a bitwise operator that represents the bitwise AND Operation,&& is a logical operator that represents the logical and (and).
The difference between 114.HashMap and Hashtable.
A: HashMap is a lightweight implementation of Hashtable (non-thread-safe implementation), they all complete the map interface, the main difference is that the HASHMAP allows null (NULL) key value (key), because of non-thread security, the efficiency may be higher than Hashtable.
115.short S1 = 1; S1 = s1 + 1; what's wrong? Short S1 = 1; S1 + = 1; what's wrong?
Answer: short S1 = 1; S1 = s1 + 1; (S1+1 operation result is int type, need cast type)
Short S1 = 1; S1 + = 1; (can be compiled correctly)
Can the 116.Overloaded method change the type of the return value?
A: The overloaded method is to change the type of the return value.

What is the difference between 117.error and exception?
A: Error indicates a serious problem in situations where recovery is not impossible but difficult. For example, memory overflow. It is impossible to expect the program to handle such situations.
Exception represents a design or implementation issue. That is, it means that if the program runs normally, it never happens.
What is the difference between 118.<%#%> and <%%>?
A: <%#%> represents a bound data source <%%> is a server-side code block
119. What do you think is the biggest difference between ASP. 2.0 (VS2005) and the development tools (. NET 1.0 or other) you used before? What development ideas (pattern/architecture) you used on the previous platform can be ported to ASP. NET 2.0 (or already embedded in ASP. NET 2.0)
A: 1 ASP. 2.0 has packaged some of the code, so it's a lot less code than 1.0 of the same functionality.
2 supports both code separation and page embedding server-side code in two modes, formerly 1.0 versions. NET hints help only in separating the code files, unable to get help tips in the page embedding server-side code,
3 when switching between code and design interface, 2.0 supports cursor positioning. I like it better.
4 in the binding data, make the table pagination. Update,delete, such as operation can be visualized operation, convenient for beginners
5 added more than 40 new controls in ASP, reducing workload
120. What is the difference between overloading and overwriting?
A: 1, the method's coverage is the relationship between the subclass and the parent class, is the vertical relationship, the overload of the method is the relationship between the methods in the same class, and is the horizontal relationship
2. Overrides can only be made by one method, or only by a pair of methods; an overload of a method is a relationship between multiple methods.
3. The override requires the same parameter list, and the overload requires the parameter list to be different.
4, in the coverage relationship, call that method body, based on the type of object (like the corresponding storage space type) to determine, overload relationship, is based on the invocation of the actual parameter table and formal parameter list to select the method body.

121. Describe the implementation of indexers in C #, and can they only be indexed by numbers?
Answer: No. Any type can be used.


125. Analyze the following code.
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 use connection pooling correctly?

Answer: If the incoming connectionstring is identical, the connection pool can be used correctly. But the exact same meaning is that the number of spaces in the hyphen is exactly the same as the order.

126. The company requires the development of a component that inherits the System.Windows.Forms.ListView class, which requires the following special features: When you click a ListView column header, you can rearrange all the rows in the view by clicking each row of rows in the column ( Sort the same way as a DataGrid). Based on your knowledge, please briefly discuss your ideas:
A: Depending on the column header of the click, the ID of the package is taken out, sorted by that ID, in the binding to the ListView

127. What is WSE? What is the current version?
A: WSE (Web Service Extension) package to provide the latest Web service security guarantee, currently the latest version 2.0.

128. In the following example
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);
}
What output is generated when you use new B () to create an instance of B?
Answer: x=1,y=0

129. In the following example

Using System;
Class A
{
public static int X;
Static A () {
x=b.y+1;
}
}
Class B
{
public static int y=a.x+1;
Static B () {}
static void Main () {
Console.WriteLine ("X={0},y={1}", A.X,B.Y);
}
}
What is the resulting output?
Answer: x=1,y=2
What is the difference between 130.abstract class and interface?
A: A class that declares the existence of a method and does not implement it is called the extraction class (abstract class), which is used to create a class that embodies some basic behavior, declares a method for that class, but does not implement the class in that class. An instance of the abstract class cannot be created. However, you can create a variable whose type is a drawing class and point it to an instance of a specific subclass. You cannot have a smoke-like constructor or a static method of pumping. The subclasses of the Abstract class provide implementations for all the extraction methods in their parent class, otherwise they are also smoke-like classes. Instead, implement the method in the subclass. Other classes that know their behavior can implement these methods in the class.
Interface (interface) is a variant of the extraction class. In an interface, all methods are drawn. Multiple inheritance can be obtained by implementing such an interface. All the methods in the interface are drawn, none of them have a program body. An interface can only define static final member variables. The implementation of an interface is similar to a subclass, except that the implementation class cannot inherit the behavior from the interface definition. When a class implements a special interface, it defines the method (which is given by the program body) to all such interfaces. It can then invoke the interface on any image of the class that implements the interface. Because of the extraction class, it allows you to use the interface name as the type of the reference variable. The usual dynamic binder will take effect. A reference can be converted to an interface type or converted from an interface type, and the instanceof operator can be used to determine whether the class of an object implements an interface.

Asp. NET common face questions and answers (130 questions)

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.