Return multiple values from a class to method

倖福魔咒の 提交于 2019-12-01 00:32:35

I think create class is better in this case

   public class MyClass
    {
        public string Corrente { get; set; }
        public string Temperatura { get; set; }
        public string NumGiri { get; set; }
    }

then

public MyClass Distri(string inArrivo)
{
    // your code

    MyClass myclass = new MyClass() {
        Corrente = corrente, 
        NumGiri = numGiri, 
        Temperatura = temperatura 
    };
    return myclass;

}

this is how you can call

Stripper strp = new Stripper();
MyClass myclass = strp.Distri(invia);

// access values as below

textBox7.Text = myclass.NumGiri;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!