1. Describe the access rights of private, protected, public, and internal modifiers.
For. Private: A privately owned member that can be accessed within a class.
Protected: A protected member that can be accessed within the class and in the inheriting class.
Public: Common members, completely public, without access restrictions.
Internal: can be accessed within the same namespace.
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. Using Server.Transfer
4. Using Application
5. Use the cache
6 Using the HttpContext Item property
7. Working with files
8. Using the Database
9. Use of cookies
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
For:
Override is different from overloading. Overloading is the same as the name of the method. Different parameters or parameter types, multiple overloads to accommodate different needs
Override is an override of a function in a base class. Achieve polymorphism.
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?
For:
With question 2nd
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? (Indexers are encapsulation of attributes, see MSDN for details)
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 ();
11. Using. NET to do b/s structure of the system, you are using a few layers of structure to develop, the relationship between each layer and why such stratification?
A: Using MVC pattern layering
Typically 3-storey
The data access layer, the business layer, the presentation layer.
The data access layer makes additions and deletions to the database.
The business layer is generally divided into two layers, the business table layer realizes the communication with the presentation layer, the business rule layer realizes the user password security and so on.
The presentation layer adds a form in order to interact with the user such as a user.
Advantages: Clear division of labor, clear, easy to debug, but also scalable.
Cons: Increased costs.
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. Small 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 (managed) code?
For:
Managed code is the code that runs the. NET common language runtime CLR
Unsafe: Unmanaged code. Not run through the CLR. Programmers allocate and free memory space themselves
17. What is a strong-named assembly?
A: The assembly requires an encrypted signature, and a strong-named assembly can be deployed to the global assembly cache as a common assembly
What classes are needed to read and write databases in 18.net? Their role?
Answer: DataSet: DataSet.
DataCommand: Executes the statement command.
DataAdapter: The collection of data, the term padding.
DataReader: Data reader
What are the authentication methods for 19.asp.net? What is the principle of the distinction?
For:
Windwos (default) with IIS control
From (form) with account
Passport (Key)
20. What is Code-behind technology?
Answer: The code is followed by.
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.
24. In C #, string str = null with string str = "" Try to use text or an image to illustrate the difference.
A: string str = NULL does not allocate memory space to him, and string str = "" Assigns it a memory space with an empty string length.
25. Please describe the similarities and differences between classes (class) and structure (struct) in dotnet.
A: class can be instantiated as a reference type, class can implement interfaces and single-inherit other classes, and can be used as base types, which are allocated on the heap of memory
A struct is a value type and cannot be a base type, but it can implement an interface that is allocated on the stack of memory.
26. Based on the knowledge of the delegate (delegate), complete the code snippet in the following user controls:
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))
{
Use the following complement code to invoke the OnNew event for the Ondboperate delegate signature.
}
}
}
Answer: if (onnew! = null)
OnNew (this, e);
27. Complete the blanks by analyzing the following code
String strtmp = "ABCDEFG xxx";
int i= System.Text.Encoding.Default.GetBytes (strtmp). Length;
int j= strtmp.length;
After executing the above code, i= j=
Answer: i=13,j=10
28.SQLSERVER server, the given table table1 has two field IDs, Lastupdatedate,id represents the updated transaction number, Lastupdatedate represents the server time when the update, use a SQL statement to obtain the last updated transaction number
Answer: Select ID from table1 Where lastupdatedate = (select MAX (lastupdatedate) from table1)
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: WebService is primarily available with HTTP, penetrating firewalls. and remoting can use TCP/IP, binary delivery to improve efficiency.
Apply for. NET Development Engineer Common face question (i) (reprint)