import external classes

Hi. I'm really new in the .net world and I would like some help with this problem.

When I did some programming in PHP did I use to put classes in separate files so I could use the classes for diffrent applications.

Is this possible with C# and how would a simpel code look like

I would be really greatfull for some code, pointers in rigth direction or a direct link to some tutorial for this issue.

Se below for description how I mean (my example is not real code!!!).

Br

Mattias Nyqvist

-----

file.1 (Not real code!!)

class fileOne

{

string message= "hello world";

}

file2.(not real code!!)

namespace mainApp

{

class mainApp

{

public static void main(){

newclass = new fileOne;

console.writeline( message);

}

}

}



Answer this question

import external classes

  • reineckere

    Thanks for all help.

    Find a really good tutorial about the subject that solved my problems.

    http://www.csharphelp.com/archives2/archive402.html

    Br

    Matt


  • ttoennies

    Thanks for the help!

    When U say reuse, do You mean cut and paste

    Does the dll project solution require studio.net tools or can one do it with a regular notepad editro and compile it

    Br

    Matt.


  • PioM

    In C#, you'd either reuse the code that contains the classes, or put them into a dll and import that into your projects.



  • import external classes