Vb.net data center charges & amp; Register text box is empty prompt, one-click clear all text box content, vb.net data center

Source: Internet
Author: User

A prompt is displayed when the & Register text box is empty. You can clear all the content in the text box with one click.

The Charging System of the second IDC has been restructured. Of course, the effect must be repeated once. As shown in the blank text box, review the first IDC, the silly If statements compromise your code affinity! So what exactly can we do to solve those repetitive judgments? At this time, we will mention the so-called Model form. Create an encapsulation array in the Model form. When you need to judge that a large number of text boxes are empty in the form, you only need to simply call it.

Create a Model class to store the required parts.

1. Define a struct Term and encapsulate an array with the struct.

Public Structure Term 'defines the struct term Dim controlSub As Control Dim strText As String Sub New (ByVal controlSub As Control, ByVal strText As String) 'initialization object With Me. controlSub = controlSub. strText = strText End With End Sub

2. Define an array of the Term type with struct

'Define a struct array of the Term type Public arrayControl () As Term

3. Function for determining whether the text box is empty

''' <Summary> ''' determines whether the text box is empty, then, the corresponding message ''' </summary> ''' <param name = "ArrayControl"> </param> ''' <returns> </returns> ''' is displayed. <remarks> </remarks> Public Function CIsEmpty (ByVal ArrayControl () as Term) As Boolean Dim termControl As Term defines a term type variable. All elements in the struct array are traversed. If the control text is empty, the following message is displayed: For Each termControl In ArrayControl, all elements In the struct array If TypeOf termControl are traversed. controlSub Is TextBox then' determines whether the control Is a text box If termContr Ol. controlSub. Text. Trim = "" then' determine whether the content of the Text box is empty. MessageBox. Show (termControl. strText & "cannot be blank! "," ", MessageBoxButtons. OK, MessageBoxIcon. Exclamation) termControl. controlSub. Focus () 'Get Focus Return True Exit Function End If
4. Of course, the function is written, but the defined struct must be initialized. We need to define a process Rdim () at the U layer of Registe to complete this function.

Private Sub Rdim () ReDim Preserve arrayControl (9) 'Re-declare array dimension 'initialize array arrayControl (0) = New Term (txtCard, "card number") arrayControl (2) = New Term (txtstudentNo, "student ID") arrayControl (3) = New Term (txtstudentName, "name") arrayControl (4) = New Term (ComboSex, "gender ") arrayControl (5) = New Term (txtgrade, "Grade") arrayControl (6) = New Term (txtclass, "class") arrayControl (7) = New Term (txtCash, "amount") arrayControl (8) = New Term (txtstatus, "comment") End Sub
5. The preparation is complete, and the rest is simple calls! You can directly call the CIsEmpty function in the Register form.
Call Rdim () 'first calls the Rdim process to initialize the array' Call the CIsEmoty () function to check whether the input text box content If CIsEmpty (arrayControl) Then Exit Sub End If
In this case, when the text box is empty, the system will automatically prompt, which is convenient and concise!

6. How can we achieve one-click cleanup? The method is the same as determining that the text box is empty. You only need to compile a clear function.

''' <Summary> ''' clear the data in the text box ''' </summary> ''' <param name = "arraycontrol"> </param> ''' <returns> return a Boolean value, true </returns> ''' <remarks> </remarks> Public Function AllEmpty (ByVal arraycontrol () As Term) as Boolean Dim termControl As Term defines a term type variable For Each termControl In arraycontrol If TypeOf termControl. controlSub Is TextBox Then termControl. controlSub. text = "" 'determines the control type. If it is a Text box or a combo box, the content is cleared. If Next Return True End Function
7. call:

Private Sub btnClear_Click (sender As Object, e As EventArgs) Handles btnClear. click Call Rdim () 'First Call the Rdim process to initialize the array' Call the AllEmoty () function to delete the content in the text box If AllEmpty (arrayControl) Then Exit Sub End If End Sub
Although the above is only described in the registration form, it is used for other text boxes and combo boxes. You only need to initialize the struct in the corresponding form and then call it directly.

Feelings:

The IDC fee is still being charged step by step. What is different from the past is that the so-called "feeling" is mature, at the very least, when you encounter problems, you will try your best to find the simplest and most practical methods to meet your needs.








Computer Room Billing

Internet cafes do not cost money ~~, Hey, be careful.

1. when windows is started normally, press ctrl + alt + del on the windows desktop to display the task manager. We can see that there is a process named client, which is the client program of Vientiane, end the task. Immediately press ctrl + alt + del again, and you will see a client process in it and kill it again. This is because Vientiane has its own anti-virus function. After the process is killed, it will start again, but it is only twice. Now we can use it. The host will no longer display a page asking for the card number and password. I have tried and tried this option repeatedly, but I have never missed it, but I need to master the timing of the buttons.
2. start the instance properly, enter your card number and password to go to the system, right-click the icon of the Vientiane customer management system on the taskbar, and select Check-out and drop-down. The system prompts whether the instance is actually down, press the "sleep" key while clicking "OK". At this time, win will prompt an error, and then you will find that you are down ,? When the overseas Chinese bed is shaken, there is a lag between the two sides. What is the problem? _ ^ We can play for free. The only regret is that the test success rate is too low. I tried more than a dozen Internet cafes only once. We recommend that you do not use it.
3. after using the card number and password to enter the system, download and read the password tool of the Vientiane management software to read the password. After reading the password, remember the password and check out the password. After the Vientiane customer interface appears, enter the password you just read in the administrator password below. OK. We all know that the Administrator passwords of Meiping and pubwin are stored locally. After opening their installation directories, you can find the setting files in them and open them in notepad. I think Vientiane should also be like this. If you cannot find the software that reads the password, you can try to crack it manually.
4. if the tool in the preceding 3 cannot be found, and the internet cafe has a restore genie, we can also use it to download the "Restore genie password reader", read the restore genie password, right-click the restore genie icon, select "set parameters", select "do not restore", and enter the password you just read. After the modification is successful, we will go to the installation folder in Vientiane. The general path is c :\\\\ Octopus or c :\\\ program files \\\ Octopus, we rename the folder directly. Restart the instance. press the reset key on the chassis to restart the instance. Do not press the hotkey. After restart, we can use it directly.
5. press f8 at startup to enter the win startup selection method. We select the pure dos mode. Generally, this is 5th items. Find the installation folder of Vientiane under dos (same as above) 4. Rename the folder. Sometimes the folder cannot be modified. You can use the attrib command to remove the folder attribute and modify it (delete the file as well). Then, enter win, it will return to the windows interface. Done !!
6. in some versions of Vientiane, keys f8 and ctrl + alt + del are not allowed. In this case, we can try this method and press alt + f4 on the Windows desktop, in this way, we can call out win's real Shutdown program. We choose to restart and enter dos. The method below is the same as Method 5.
7. if all the above hotkeys are not allowed, we also have a method, that is, the Input Method Vulnerability. after entering the Vientiane client interface, adjust the input in the input card number and bring up the soft competition, enter a letter, followed by a status bar under the letter, right-click it, and select help to open the Help file, because Vientiane will lock the range of mouse movement, we can drag the Help file with the mouse. As long as it breaks the locked edge, the mouse can be moved freely, right-click the title bar, and select "Jump ", in the displayed box, enter the drive letter, path of the specific file, or enter the website address to open the webpage. The verification card number and password must be bypassed.

The above 7 method can be said to be an abnormal computer method. It is recommended to use it when there are few Internet cafes. The icons displayed on the normal computer and abnormal computer are different on the Management Server of Vientiane, if many people in the internet cafe queue and wait for a host, but the network administrator finds that the host is still empty, then you will be born ...... remaining full text>

Urgent !!!!!!!! What is the relationship between vbnet and vsnet?

Vs.net includes vb.net, c #, vc ++, etc!

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.