Jump to content

Chamar Função de Outro Ficheiro .cs para o Actual


nunolevezinho

Recommended Posts

Olá como podem ver a minha dúvida é bem simples. Tenho dos ficheiros c#. Num tenho várias funções. E no outro quero chama-las quando precisar delas.

A minha dúvidá é como faço isso :\ Em php era so dar include e "chamar" a função. Mas em C# não sei como é :|

Alguem me dá umas luzes?

http://img221.imageshack.us/img221/2948/55438617.png

Link to comment
Share on other sites

O C# faz include automatico, basta meteres o namespace e funciona, no teu caso penso que tenhas que meter:

using Informito.Admins;
using Informito.Dados;

Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender.

A beleza de um código está em decompor problemas complexos em pequenos blocos simples.

"learn how to do it manually first, then use the wizzy tool to save time."

"Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."

Link to comment
Share on other sites

Tens igualmente de o incluir, vês no inicio do ficheiro os using? É isso mesmo que que tens de usar.

Depois, dependendo da definição do que queres usar, se não é um singleton, ten de criar uma instância, depois invocas o método.

10 REM Generation 48K!
20 INPUT "URL:", A$
30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50
40 PRINT "404 Not Found"
50 PRINT "./M6 @ Portugal a Programar."

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.