(string)是强制类型转换整条赋值号右边的 语句,(hellofrom)也是强制转换form,之后调用getuserName方法

解决方案 »

  1.   

    string userName =(string)((helloform)form).getuserName();
    这句话是要干下面这些事:1。把form强制转换成helloform类;(看来holleform类可能是form的子类)
    2。调用这个类的getuserName方法;(form类没有这个方法,它是在子类中定义的)
    3。getuserName方法返回一个值,这个值不是String类的;
    4。将这个值强制转换成String类的对象;
    5。将这个转换后的String对象赋值给userName。