help required in c# programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nabh4u
    New Member
    • Jan 2007
    • 62

    help required in c# programming

    hi friends,

    i am new to csharp programming. i have got a program from my friend which is used for ping so that it should give the ip address or so. i have 2 projects in 1 application. i need to use the classping into another class file and then these two should be used in the first project which has the main file with main function. i dont know how to pass these values like the ipaddress, host name to the main file so that i can display them. i also need to use a sleep() for 10 sec. please give me tips as to how i can pass those values and work on my project.

    thank you in advance
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Originally posted by nabh4u
    hi friends,

    i am new to csharp programming. i have got a program from my friend which is used for ping so that it should give the ip address or so. i have 2 projects in 1 application. i need to use the classping into another class file and then these two should be used in the first project which has the main file with main function. i dont know how to pass these values like the ipaddress, host name to the main file so that i can display them. i also need to use a sleep() for 10 sec. please give me tips as to how i can pass those values and work on my project.

    thank you in advance
    I think you may be confused. If you have 2 projects they must be in one *solution* if your application uses two different .cs files then that is a seperate issue. If your classping is a class then you can save the ipaddress and host name in some member data that you can then expose through public methods. Your main method can then access those addresses and use them.

    If you are interested in using the sleep() method for a thread you should try searching for that in MSDN since they will outline all the proper syntax and usages.

    Comment

    • nabh4u
      New Member
      • Jan 2007
      • 62

      #3
      Originally posted by RedSon
      I think you may be confused. If you have 2 projects they must be in one *solution* if your application uses two different .cs files then that is a seperate issue. If your classping is a class then you can save the ipaddress and host name in some member data that you can then expose through public methods. Your main method can then access those addresses and use them.

      If you are interested in using the sleep() method for a thread you should try searching for that in MSDN since they will outline all the proper syntax and usages.
      thank you very much. you are right, i have 2 projects in one solution.
      could you tell me how to save that information in member data and then use from my main method?
      please atleast give me some hint or sample code.

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by nabh4u
        thank you very much. you are right, i have 2 projects in one solution.
        could you tell me how to save that information in member data and then use from my main method?
        please atleast give me some hint or sample code.
        I think you'd be better served by doing a search on MSDN and following some of the tutorials stickied at the top of this forum.

        Understanding how to create classes and member variables and fields of data is a cornerstone of C# development. You should master these aspects before attempting to dive into network programming.

        Comment

        • ramseszii
          New Member
          • Dec 2007
          • 1

          #5
          Originally posted by nabh4u
          hi friends,

          i am new to csharp programming. i have got a program from my friend which is used for ping so that it should give the ip address or so. i have 2 projects in 1 application. i need to use the classping into another class file and then these two should be used in the first project which has the main file with main function. i dont know how to pass these values like the ipaddress, host name to the main file so that i can display them. i also need to use a sleep() for 10 sec. please give me tips as to how i can pass those values and work on my project.

          thank you in advance

          Im new too, but I know that the sleep you are seaching for is this:

          Code:
          System.Threading.Thread.Sleep(5000);
          // Sleeps for 5 seconds

          Comment

          Working...