help u up=======================================================

解决方案 »

  1.   

    在其他地方声名一个类的实例a,a.Person(x)就行了。然后你定义一个结构的实例进行接收就行了!
      

  2.   

    public struct str
    {
        public int iAge;
        public string sCharat;
        public bool bFlag;
        public string sWork;
        public int iCount;
    }public class strTest
    {
        private str mystr;
        public str Person(string sName)
        {
            str s;
            s.iAge = 20;
            s.sCharat = "sCharat";
            s.bFlag = true;
            s.sWork = "sWork";
            s.iCount = 1;
            //这里的代码就是能给该结构体各变量赋值
            return s;//这地方该怎么写呢??????
        }
    }
      

  3.   

    重点是要把结构体内的变量设置为public
    public struct str
    {
     public int iAge;
     public string sCharat;
     public bool bFlag;
     public string sWork;
     public int iCount;
    }
    private void Page_Load(object sender, System.EventArgs e)
    {
                str str;
    str.iAge=10;
    str.sCharat="a";
    str.bFlag=true;
    str.sCharat="c";
    str.iCount=10;

                                                                                          

    }
      

  4.   

    public struct str
    {
     public int iAge;
     public string sCharat;
     public bool bFlag;
     public string sWork;
     public int iCount;
    }
      

  5.   

    你试一下这样子写
    private str mystr = new str();