« Home « Chủ đề tư liệu lập trình

Chủ đề : tư liệu lập trình


Có 60+ tài liệu thuộc chủ đề "tư liệu lập trình"

Variables C# interfaces

tailieu.vn

If you wanted to add 1 to a variable, you could use the + operator:. Whether you use the prefix or postfix form of the. For example, if you. the value of count increases by 1, and if you write ++count, the value of count also increases by 1. In the expression x. the variable x occurs first, so its...

Applications Built Security

tailieu.vn

Applications built by using the Microsoft .NET Framework have a range of mechanisms available for ensuring that the users who run those applications have the appropriate privileges. Some of the techniques available rely on authenticating users based on some form of identifier and password, whereas others are based on the integrated security features of Microsoft Windows. accessed over the Internet,...

Windows Style Guide

tailieu.vn

If you look at most Windows applications, you'll notice that some items on the menu strip tend to appear repeatedly in the same place, and the contents of these items are often predictable. For example, the File menu is typically the first item on the menu strip, and on this menu, you typically find commands for creating a new document,...

Windows Web Sever Strack

tailieu.vn

Pop-Up Menus. Many Windows applications make use of pop-up menus that appear when you right-click a form or control. These menus are usually context-sensitive and display commands that are applicable only to the control or form that currently has the focus. Creating Pop-Up Menus. In the following exercises, you will create two pop-up menus. The first pop-up menu is attached...

ADO.NET Databases With .NET Framework

tailieu.vn

Using ADO.NET Databases. With the advent of the .NET Framework, Microsoft decided to update its model for accessing databases, ActiveX Data Objects (ADO), and created ADO.NET. ADO.NET contains several enhancements over the original ADO architecture, providing improved interoperability and performance. If you are already familiar with ADO, you will notice that the object model of ADO.NET is a little different....

C# Arithmetic Run

tailieu.vn

for multiplication, and the forward slash. In the following example, the variable moneyPaidToConsultant ends up holding the product of 750 (the daily rate) and 20 (the number of days the consultant was employed):. In the expression 750 * 20, the * is the operator, and 750 and 20 are the operands.. Not all operators are applicable to all data types,...

Suppose Minimum Value

tailieu.vn

public static int Min(int[] paramList). throw new ArgumentException("Util.Min");. To use the Min method to find the minimum of two int values, you would write this:. int min = Util.Min(array);. You can see that this solution avoids the need for a large number of overloads, but it does so at a price: You have to write additional code to populate the...

NOT Operator

tailieu.vn

In the previous example, if the value of the variable areYouReady is true, the value of the expression !areYouReady is false.. You use these binary operators to find out whether a value is the same as another value of the same type. Equal to age. Not equal to age. operators to find out whether a value is less than or...

Integer Arithmetic In Chapter

tailieu.vn

Using Checked and Unchecked Integer Arithmetic. In the project properties dialog box, click the Build tab.. Click the Advanced button in the lower-right corner of the page. In the Advanced Build Settings dialog box, select or clear the “Check for arithmetic overflow/underflow” check box.. Regardless of how you compile an application, you can use the checked and unchecked keywords to...

Dialog Print A File

tailieu.vn

The Bell Ringers application now allows you to save information, but it always saves data to the same file, overwriting anything that is already there. There are a number of everyday tasks that require the user to specify some sort of. For example, if the user wants to print a file, the user is usually asked which printer to use,...

Encapsulation-Important Principle

tailieu.vn

namespace System.Windows.Forms. private System.Windows.Forms.Button okay;. this.okay = new System.Windows.Forms.Button();. this.okay.Click. new System.EventHandler(this.okay_Click);. private void okay_Click(object sender, System.EventsArgs args). new System.EventHandler (this.okay_Click);. this.okay_Click;. The System.Object Class. To fully appreciate the significance of the System.Object class requires that you understand inheritance, which is described in Chapter 12, “Working with Inheritance.” For the time being, simply accept that all classes are specialized types...

Most Classes Describes

tailieu.vn

For example, monthName(1) returns “January.” The question is: what should the method return when the integer argument is less than 1 or greater than 12? The best answer is that the method shouldn't return anything at all. In the following exercises, you will add code that throws and catches exceptions to the MathsOperators project.. Type 24 in the left operand...

Trying Code C#

tailieu.vn

C# makes it easy to separate the code that implements the main flow of the program from the error handling code, by using exceptions and exception handlers. Write your code inside a try block (try is a keyword). When the code runs, it attempts to execute all the statements inside the try block, and if none of the statements generates...

Consider Happen Erro

tailieu.vn

To obtain the value of the boxed copy, you must use what is known as a cast, an operation that checks that it is safe to convert one type to another, and then does the conversion. You prefix the object variable with the name of the type, in parentheses, as in this example:. Keep in mind that boxing and unboxing...

My Double Method

tailieu.vn

public static void MyDoubleMethod(double parameter). For example, an int can be implicitly converted to a double. An implicit conversion requires no special syntax and never throws an exception:. Example.MyDoubleMethod(42. An implicit conversion is sometimes called a widening conversion, as the result is wider than the original value—it contains at least as much information as the original value, and nothing is...

Higher Precedence C#

tailieu.vn

For example, the + operator means. For example, the * operator has a higher. precedence than the + operator. This means that the expression a + b * c is the same as a + (b * c).. Each operator symbol also has an associativity to define whether the operator evaluates from left to right or from right to left....

The Sqrt Method Data

tailieu.vn

In the previous exercise you used the Sqrt method of the Math class. The Math object would play no part in the calculation of the square root. All the input data that Sqrt needs is provided in the parameter list, and the single result is returned to the caller by using the method's return value. Incidentally, the Math class also...

Statement Won't Compile

tailieu.vn

(In contrast, the specification of what statements do is collectively known as semantics.) One of the simplest and most important C# syntax rules states that you must terminate all statements with a semicolon. In the chapters throughout this book, you'll see examples of the most important C# statements.. Understanding the Internet as an Infrastructure. performance of your own local network...

GetErrors Products DataTable

tailieu.vn

The first statement extracts the Products DataTable in the changes. The GetErrors method of a DataTable object returns an array of all the rows in the table that have one or more validation errors. If no errors then update the database, otherwise tell the user comment with the following code block:. Update the database 5. Find the errors and inform...

DataSet Can Overcome

tailieu.vn

In the exercises so far in this chapter, you have seen how to fetch data from a database.. Instead, a better approach is to connect to the database, fetch the data into a DataSet object, and then disconnect again. The user can browse the data in the DataSet and make any changes required. After the user finishes, the program can...