我先建各类A,实现如
string abcA a=new A();
abc=a.b.c
不知如何建

解决方案 »

  1.   

    我是说我想见一个类A,实现
    A 张三=new A();
    张三.中国.省份="河北"
    b=张三.中国.省份
    b为河北省
    如何建这个类?
      

  2.   

    using System;
    using System.Collections;public class MyClass
    {
    public static void Main()
    {
    a_Class a = new a_Class();
    a.b.c = "3333";
    System.Console.WriteLine(a.b.c);
    }
    private class b_Class
    {
    public string c = "";
    }
    private class a_Class
    {
    public b_Class b = new b_Class();
    }
    }
      

  3.   

    public class A
    {
     private Country country;
     public Country Country
     {
       get
       {
         return this.country;
       }
       set
       {
         this.county = value;
       }
     }
    }
    public class Country
    {
     private string city;
     public string City
     {
       get
       {
         return city
       }
       set
       {
          this.city = value;
       }
     }
    }
      

  4.   

    public class A
    {
    public A()
    {
    }
    public string Convert(string str)
    {
    string s = "";
    for(int i = 0;i<str.Length;i++)
    {
    s = str[i]+".";
    }
    return s.Substring(0,s.Length-1) ;
    }
    }
      

  5.   

    谢谢大家
    还有一个问题
    http://community.csdn.net/Expert/topic/4544/4544705.xml?temp=.6730463
    不胜感激