楼主再使用myclass时候是否能够找到myclass类呢
需要导入namespace才能用

解决方案 »

  1.   

    比如你的myclass是这样定义的
    nemespace AAA
    {
     public class myclass
     {}
    }那么或者使用
    AAA.myclass
    或者在头部声明using AAA;
      

  2.   

    mystr这个是不是没有定义呢?
      

  3.   

    string mystr = "abc";
    myclass toy = new myclass(); 
    toy.teststr(mystr); 
      

  4.   

    如果放在appcode裡的話,不需要增加什麼命名空間的。
    放在裡可以隨意調用的啦。。
      

  5.   


    Error 12 'myclss' does not contain a definition for 'teststr' and no extension method 'teststr' accepting a first argument of type 'myclass' could be found (are you missing a using directive or an assembly reference?) 
     
    这个的编译错误是啥意思呢?
      

  6.   


    提示: myclass 没有定义teststr 并且没有继承任何 名叫teststr的方法是接收一个myclass参数的
    也就是说楼主在传参数的时候出现错误,传进去的是一个myclass类的对象,而不是要求的string 类型参数