Activity Stream
48,167 MEMBERS
6923 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31
  1.     
    #11
    Respected Developer
    You can use 'this' but not to access static members. And only the programs entry point is required to be static. The rest is up to you.

    PS: msdn.com

  2.   Sponsored Links

  3.     
    #12
    ლ(ಠ益ಠლ)
    Website's:
    extremecoderz.com
    dont ask me about all that lol. Ask me how, ill show you, ask me all those questions, ill give you "the face" - a.k.a. -

  4.     
    #13
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    ya static = method thats not able to be called from an "instance".

    PHP Code: 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace 
    Litewarez
    {
        class 
    Program
        
    {
            static 
    void Main(string[] args)
            {
                
    object Output = new Output(); /*Just learning multiple objects*/
                
    Output.Send("This is a test"); /*This i expect to work be C# sharp goes nooo noo no*/
            
    }
        }

        class 
    Output 
        
    {
            public 
    void Send(string Text)
            {
                
    Console.WriteLine(Text);
            }
        }

    Heres the error, i have tried myself so please don't be like bitch gtfo. i you for helping

    'object' does not contain a definition for 'Send' and no extension method 'Send' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  5.     
    #14
    Respected Developer
    no, static has nothing to do with the class. What you describe is a 'sealed class'.

    Also:
    Code: 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace Litewarez
    {
        class Program
        {
            static void Main(string[] args)
            {
                Output op = new Output(); /*Just learning multiple objects*/
                op.Send("This is a test"); /*This i expect to work be C# sharp goes nooo noo no*/
            }
        }
    
        class Output 
        {
            public void Send(string Text)
            {
                Console.WriteLine(Text);
            }
        }
    }
    I suggest you read a good eBook first. You don't fly a plane without knowing how to fly.

  6.     
    #15
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    See now Output op = new Output(); to me is pointless, it should automatically know that what object it is from the call.

    Would you do

    OtherOutput oop = new Output(); ??

    yea i have a lot of books but i cant read xx
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  7.     
    #16
    Respected Developer
    [type_name] [var_name] = new [type_name];

    Don't try to apply PHP rules to C#. PHP is a dynamic language, C# a strongly typed one (meaning there is type safety). Again, ebook .

  8.     
    #17
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    No Hyperz, i wasn't trying to think like PHP on this bit, im just saying it seems Pointless to have.

    [type_name] [var_name] = new [type_name];

    because C# should know the type_name from the new [type_name] i don't get why we have to wrtie the object name 2 times as your only assigning a reference to a variable :/

    Having:

    [var_name] = new [type_name];

    yype_name should already know its an instance of Output.

    Theres more than likly a perfect excuse as Obv the main C# guys are way advanced i just don't know the reason why.. then again EBOOK loool

    Thanks for the info tho!

    Also my first bit of C#

    PHP Code: 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace 
    Litewarez
    {
        class 
    Program
        
    {
            
            static 
    void Main(string[] args)
            {
                
    Output Output = new Output();

                
    //Ask the Question
                
    Output.Send("Please Enter your name");

                
    //Get the name
                
    var name Output.ReadInput();

                
    //Clear the screan from "login xD"
                
    Output.Clear();

                
    //Send a welcome message
                
    Output.Send("Welcome: " name);

                
    //Chill out!
                
    Console.Read();
            }
        }

        class 
    Output 
        
    {
            public 
    void Send(string Text)
            {
                
    Console.WriteLine(Text "\n");
            }
            public 
    void Clear() 
            {
                
    Console.Clear();
            }
            public 
    string ReadInput() 
            {
                return 
    Console.ReadLine();
            }
        }

    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  9.     
    #18
    Respected Developer
    Again, C# is NOT a dynamic language. http://en.wikipedia.org/wiki/Type_safety

    These are all the very basics. That's why I keep saying read an ebook. If you're not willing to do that you're never gonna be good at it. Asking us for help here and reading a tut here and there will not get you far. I know I might sound a bit harsh here but that's how it is. What you're asking here now is something that gets explained in the first pages of any good eBook.

    And again, when dealing with C#, forget you ever learned PHP because you'll get confused trying to apply scripting logic to programming logic.

  10.     
    #19
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Ok i will, Try.

    And yea i will read Professional C# 2008 (http://www.amazon.co.uk/dp/047019137...ackoverfl08-20)

    ill print it at Work looooooooool
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  11.     
    #20
    The Wise One
    Website's:
    twilight.ws ddlrank.com
    I was just about to post the same thing. You should really start out with the basics before coding anything serious lol

    EDIT: If you can't find a good eBook PM me Ill try and get the one I had in college.
    I can always be contacted by sending a tweet @twilightws

Page 2 of 4 FirstFirst 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Hyperz.. I need your help.
    By R4Z0R3 in forum Technical Help Desk Support
    Replies: 0
    Last Post: 4th Jun 2010, 05:25 AM
  2. Hyperz.. I need your help.
    By R4Z0R3 in forum Technical Help Desk Support
    Replies: 8
    Last Post: 3rd Jun 2010, 02:52 AM

Tags for this Thread

BE SOCIAL