(Originally) C sharp remarks (I)

Source: Internet
Author: User

Question) the most gentle bow, like a sleep Lotus is so cool.

 

1) receive

The company's Department X has a small app project. The app background is C sharp MVC, which provides a C sharp web from for administrator operations. This project was written by an intern, it does not belong to me, so I understand this. Later, the intern did not come, so all the bugs from Android to WP to iOS to the background were thrown to me.

Now many college students complain that they cannot find a job, but many of them are really bad people. Remember that last year, the work environment was quite a bus, nine to six in the morning, I never worked overtime, I had to work on weekends, and I went out for a tour on time. Then the company recruited five interns. These interns did this for a while and said "no, I don't want to go to work anymore. My HR sister called and asked me if she couldn't go to work. Then she asked her to return the access card. Later, I didn't go to work.

I have not studied C sharp in depth. I want to work on a project this time. I have the source code in hand, and the msdn is there, so I cannot conquer your little C sharp, why? So I am exhausted. According to the bug list, I tried to go back to msdn and put it in other languages. These bugs are some of the entry-level problems, but I have not gone deep into C sharp, also slowly.

1): all the background web systems logged on by the entire administrator cannot be updated.

Solution: C sharp has a page_load. I think this method is amazing. Because this method is executed every time a page is loaded, the page details are displayed here, the post submission of the form will execute this method again before submitting the form. Because this method is executed when the form is submitted, the value in the input is replaced by the database value, as a result, the data is overwritten. As a result, Microsoft's solution in msdn is to determine whether this method is called for the first time:

    

Protected void page_load (Object sender, eventargs e) {If (! Page. ispostback) {showdata (); // display page details }}

I didn't want to understand the significance of calling this method again before post.

 

2) Wonderful data, because I see the MVC code in the background and did not generate the app client. The app background adopts the MVC mode. The client returns JSON through HTTP requests, as a result, you can get familiar with the Code by logging on. The entire login process has nothing to do with its functions, that is, the implementation is too messy. From the database perspective:

  

The first thought is what encryption method is used by this device. I browsed the code three times and did not find any suspicious encryption. login verification is implemented using the stored procedure, it's basically a few simple words, So I thought about it, right ....

 

  

Insert a message. I rely on it. The database is not encrypted. This string looks like ciphertext, And it is written into the database in plain text. It shouldn't have been written to the code, if MD5 is not used.

 

3) after handling the problem of 1 mol for me, there was a place in the activity topic that could not be modified. So I tried to check the problem again and found that sqlexception was thrown in this place, exception information:

    

E: the 'Pr _ action_updateactionbyactionid' parameter is required, but this parameter is not provided.

It is clear that there is no value assignment. Check the code again:

  

The problem is that the parameter name here is not written correctly, that is, a value is assigned to a field that does not exist in the Database and passed to the stored procedure. This error is amazing, this field does not exist and is not assigned a value.

These problems are difficult to solve ..

 

Note) the problem in the backend is basically handled in one day, and then thrown online. The customer complained about the problem. Login Failed, registration failed, and the process was too slow, the speed is because the UI of a third-party module is used, and many Google CSS files are loaded in the module. People who join the third-party module are not familiar with it and are not removed, resulting in the whole system being slow everywhere.

 

PS: In general, C sharp is still good. It is easy to write, and the threshold for C shrap is very low when J2EE is used. I am thinking about making a software program to convert the Java code into a case-sensitive one, then the Java code can be changed to C sharp ..

Study this when you are free.

(Originally) C sharp remarks (I)

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.