Click here to Skip to main content
15,905,419 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
here please any one explain this code i done this code in project but dont understand how this actually works and some commnads i dont understand it

C#
protected void Button7_Click(object sender, EventArgs e)
            {
              ]
    
                        string docname = String.Empty;
                        string emailID = String.Empty;
                        string dropdownvalues = String.Empty;
    
                         if (Session["Login2"] != null)
                        {
                            approver = Session["Login2"].ToString();
                        }
                        if (Session["UserDesignationID"] != null)
                        {
                            Designationn = Session["UserDesignationID"].ToString();
                        }
    
                        if (DocName.ToString() != "")
                        {
                            docname = DocName.ToString();
                        }
                        else
                        {
                            docname = "Unavailable";
                        }
                        if (emailId.ToString() != "")
                        {
                            emailID = emailId.ToString();
                        }
                        else
                        {
                            emailID = "Unavailable";
                        }
    
                        if (dropdownvalue.SelectedItem.ToString() != "")
                        {
                            dropdownvalues = dropdownvalue.SelectedItem.ToString();
                        }
                        else
                        {
                            dropdownvalues = "Unavailable";
                        }

any one can please explain this
Posted
Updated 21-Feb-14 8:32am
v3
Comments
Sergey Alexandrovich Kryukov 21-Feb-14 14:22pm    
If you don't understand code, don't use it. This request in counterproductive. Why should we look at the code taken who-knows-where?
Write your own code, ask some questions if you face some problems...
—SA
Diya Ayesa 21-Feb-14 16:35pm    
ok so please u remove ur comment i also remove my unncessary post
Sergey Alexandrovich Kryukov 21-Feb-14 16:43pm    
Which post or comment? if it's wrong, I will gladly remove it, but please understand: I am not making any deals. You too, might understand: everyone can see all your posts. I your post is somehow wrong, everyone can see it. So you might want to remove some of your posts, not me... How can it be a subject of deals?...
—SA
Diya Ayesa 21-Feb-14 23:23pm    
i remove it also.. and thankx for correcting my mistake ..
Sergey Alexandrovich Kryukov 22-Feb-14 0:13am    
Oh, thank you, for understanding.
—SA

1 solution

No. There are two reasons:
1) Do you have any idea how much work explaining code line by line is?
Every single line needs a paragraph of explanation! For example:
int next = r.Next();

Create a new variable called "next" which can hold a integer value. From the previously declared Random instance "r", call the "Next" method to get a new random number, and assign it to the "next" variable.

Can you imagine how long it would take us to explain even a very short code fragment like your example, line by line?

No. It is not going to happen. If you have a specific problem, then ask a question about it. But think first - would you want to sit down for 45 minutes and type up a line-by-line description for no good reason?

2) You wrote it, so you should understand it. Unless, of course your idea of "i done this code in project" actually means "I found this on the internet and I think it does what I want, but I can't be bothered to work it out myself"?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900