在代码中以此开头的实用工具是什么 [英] what is the utility to begin with this in the code

查看:92
本文介绍了在代码中以此开头的实用工具是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
如果代码没有它正常运行,则this的实用工具是什么(this)

this.dataGrid1 DataSource = datc.dSet.Tables ["PersonTable"];

Hii,everyone
what is the utility of begin with this ,if code run normal without it (this)

this.dataGrid1 DataSource = datc.dSet.Tables["PersonTable"];

推荐答案

在您的上下文中没有什么区别,但是如果您使用相同的名称,则引用使用this(您所属方法的当前类)可以为您提供所需的正确属性/对象/字段.
In your context it makes no difference, but if you have same names, the referencing with this (the current class the method in which you are belongs to) will give you the correct property/object/field you want.


这篇关于在代码中以此开头的实用工具是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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