You need to use "using namespace1;" in top of your .cs file
using System;
using namespace1;
public class myclass2
{
public static void Main ()
{
myclass1 obj = new myclass1();
obj.mymethod();
}
}
>Using C#.
>
>How can I access another class in a different .cs file.
>
>For example, how can I get myclass2 in namespace2 to access something in myclass1 namespace1?
>
>////////////////////////////////
>//one.cs
>using System;
>
>namespace namespace1
>public class myclass1
>{
> public string mystring = ""
>}
>////////////////////////////////
>
>////////////////////////////////
>//two.cs
>using System;
>
>namespace namespace2
>public class myclass2
>{
>
>public static void Main ()
>{
>///Access namespace1.myclass1 in one.cs here.
>}
>
>}
>////////////////////////////////
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi