什么是用于标识应用程序对象的代码 [英] what is the code for identifying object of an application

查看:77
本文介绍了什么是用于标识应用程序对象的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在应用程序屏幕中识别诸如编辑框,按钮,图像或链接之类的对象,例如具有用户名,密码,Gmail图标等对象的Gmail登录页面

什么是代码?这个。

解决方案

尝试

  foreach (在页面中控制c 
{

MessageBox.Show( 类型: + c.GetType());

}





这为您提供了每个控件的类型,然后您可以使用它来获取类型想。


How to identify the objects like editbox,button,image or a link in an application screen like a gmail login page having objects like username ,password, a Gmail icon
what would be the code for this.

解决方案

Try

foreach (Control c in page)
{
 
      MessageBox.Show(" Type:"+ c.GetType());
  
}



This gives you the type of each control which you can then use to get the type you want.


这篇关于什么是用于标识应用程序对象的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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