在asp.net中批准的代码EXPALNATION [英] CODE EXPALNATION of approve in asp.net

查看:72
本文介绍了在asp.net中批准的代码EXPALNATION的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里请任何人解释这个代码我在项目中完成了这个代码,但是不明白这实际上是如何工作的和一些我不理解的共同点



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

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

推荐答案

没有。有两个原因:

1)您是否知道逐行解释代码的工作量是多少?

每一行都需要一段解释!例如:

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();



创建一个名为next的新变量,它可以包含一个整数值。从先前声明的Random实例r,调用Next方法获取一个新的随机数,并将其分配给next变量。



可以你想象我们需要多长时间才能解释一个像你的例子一样的非常短的代码片段,一行一行?



不会发生这种情况。如果您有特定问题,请询问有关它的问题。但首先考虑一下 - 你想坐下45分钟然后输入逐行描述没有充分理由吗?



2)你写了,所以你应该理解它。当然,除非您对我在项目中完成此代码的想法实际上意味着我在互联网上发现了这一点,我认为它符合我的要求,但我不能被打扰自己解决


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"?


这篇关于在asp.net中批准的代码EXPALNATION的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆