Questions About Programming

6 pages
1426 words
Type of paper: 
This essay has been submitted by a student.
This is not an example of the work written by our professional essay writers.

Post 1

Trust banner

If this sample essay on"Questions About Programming" doesn’t help,
our writers will!

If the user is typing data into a TextBox and types an invalid character, the program should display a message box telling the user that there is an error. Controls put in place cannot help the user to select valid values as human beings sometimes do make errors. In this case, the program should not be controlling the user the user to select every possible value but rather it should allow the user to key in the values and then carry out the validation according to the programs setting. The program should be designed in such a way that it is friendly in validation of values, for instance, validating every keystroke can be annoying as it will interrupt the user with error messages and sometimes the values might not be valid but it part of valid value

Post 2

If the user types an invalid value into a TextBox and moves focus to another TextBox, the program should Force focus back into the TextBox that contains the error. The validating event provides a parameter of type CancelEventArgs that contains a cancel property. If the user has set the property to true, the program will then cancel the entire event that moved focus to this group. This traps the user back to the field that contains the error so as to fix the input problem. The users should set the property true because the values in the present TextBox may depend on the previous TextBox values.

Post 3

If the user enters some invalid data on a form and then clicks the forms Accept button, the program should Change the background color of TextBoxes containing invalid values to indicate the errors. The program colors the invalid data but allow the user to use the form until the user make necessary changes, the color cannot disappear. The program also Display a message box telling the user that there is an error and close the form until the user corrects all the error. The users workflow is disrupted and is forced to make changes before proceeding.

Post 4

Regex. IsMatch

When the users values have been validated during input, what follows is the actual validation. Various approaches are used to actualize the validation including the regular expression that determines if the entire string matches a pattern and try to look for pieces of string that match that pattern and replace with the new value string. A program can use objects provided by regex class to work with the regular expression and regex. IsMatch purpose is to return true if regular expression matches the string.

Post 6

B. ^[a-zA-Z0-9_]{6,16}$

In the regular expression, various literal characters and characters have unique meaning. For instance, the sequence (a-z) implies that the Regex object should match any single character between a through z. furthermore, in the regular expression, special values are represented by special character sequence known as escape sequence, for example \ c matches a word boundary while \b matches any digit 0 through 8. If you want to make use of the character, you need to escape it by adding b \in front of it like \

Post 8

D.All of the above

The Debug. Assert method is ignored in release builds i.e. the using if statement to taste the data and then throw an exclusion if the data is not valid. The program must continue running even if a Debug. Assert method stops the program. When an assertion fails in debug builds, the Debug. Assert method lets you halt,

Debug the program, or continue running. The halt enables the user to find out what really went wrong and the program can still resume if you click okay.

Post 9.

B. The Debug class generates messages if DEBUG is defined. The Trace class generates messages if TRACE is defined.

Is regularly helpful an individual to have an application to create information in the form of debugging or trace messages while it executes. Before the introduction of visual C# It was not easy to come out with infrastructure to display this information and hence this process was time consuming and difficulty.

Chapter 12

Post one: Symmetric algorithm

The best algorithm that best fits company X is symmetric algorithm which is also refer to as shared secret encryption, in this algorithm, the encryption of data is done with an encryption key a byte array and the same key is at the same time used to decrypt the data. The algorithm relies on the fact that that it is only an authorized person can access the encryption key and hence any other person cannot decrypt the data. The only disadvantage is that if this encryption key is tempered with then the decryption process may fail leading to loss of data.

Pos two: Asymmetric algorithm

Asymmetric algorithm is a method that can safely send data within different machines. The main reason why asymmetric is efficient among different machine is that the encryption key which is so vulnerable, is not shared. Asymmetric encryption uses two mathematically related keys that accompaniment one another in such a way that what is encrypted with one key can only be decrypted with another key. The public key is made public so that any person who wants to transmit secured data can encrypt the data and when it comes to decrypting of the data, only the receiving party can use the other key to do so.

Post three: Hashing algorithm

In hashing algorithm, the key in public-key encryption is based on the hash value. The hashing algorithm computes the hash value from a base input. Basically; this hash value is a summary of the original value. The unique feature about this value is that it is not possible for any person to derive the original input number without the knowledge about the data that was used to come up with the hash value. For example, the input number may be 10,667while hashing algorithm is x 143.the hash value is 1,525, is not easy to know that 1,525,381 came from multiplication of the two.

Post four:sha.GetHash (userData);

It is advisable to store the password in plain text as this is unsecure because if the data is tempered with, it means that the password is compromised too. The password are hashed whereby, the hash of the password is saved instead of the password. If at all someone attempts to log in, you can hash the password and validate that the two hashes are the same.

Post Five: ProtectedData.Protect(userData, null, DataProtectionScope.LocalMachine);

Some people may sometimes want to keep their data safely without thinking of too much about the algorithm they used. In order to achieve this System.Security.Cryptography namespace one static class which is referred to as protectedData which is offered? The class if further divided into two methods, namely protect which comprises of encrypt of data while the second is used in decryption of data and both accept three parameters. The first represents userData or encrypted Data while the second is known as optionalEntropy while the last one is referred to as scope which is of DataProtectionScope.

Post six: ProtectedData.Unprotect(encryptedData, null, DataProtectionScope.CurrentUser);

This is applicaple to individual who want to keep the data without the hustle of incorporating the use of algorithm. The scope parameter specifies which individual can decrypt the data and it takes care of DataProtectionScope.CurrentUser and DataProtectionScope.LocalMachine values. But in this case we are looking for a code to be used to encrypt an array that can be encrypted by the current user. The first procedure is that someone should specify that it is only the current user who can decrypt the encrypt data while the second specifies that data can only be decrypted by the loge-in user into the machine.

Post seven: All of the above

The net of the assembly is made up of four parts namely, the friendly name which is name of the assembly without extension. The culture represents the culture of the assembly especially when the programmer wants to localize the application for different markets. For every region, the programmer creates an assembly that is made up of the code for the application to be localized. Assembly version is where you decide to come up with different versions of assemblies to meet the needs of different market

Post ten: A signed assembly

For any assembly to have a strong name, it should be signed with both private and public keys. The private key is used to sign the assembly digitally while the public keys main function is to confirm the signature.

If you want discreet, top-grade help, order a custom paper from our experts.

If you are the original author of this essay and no longer wish to have it published on the SuperbGrade website, please click below to request its removal: