Jump to content

  •  

  • iBotModz CBox


    Photo

    Getting Your IP C#


    • Please log in to reply
    4 replies to this topic

    #1 xXxStevenxXx

    xXxStevenxXx

      Corporal Grade 1

    • Donors

    • 202 posts
    • Joined: 29-June 08
    • Gender:Male

    Posted 09 November 2009 - 08:26 PM

    1.) Let's start by creating a new C# Windows Application ( File -> New -> Project -> Windows Application ). Name the project What ever you like.

    2.) Put this at the using method
    using System.Net;

    3.) Make an TextBox Anywhere in the Form

    4.) Double click the Form1 And it should take you to private void Form1_Load And add the following Code
    //Get the host
     string myHost = System.Net.Dns.GetHostName();
     // Get the IP 
     string myIP = System.Net.Dns.GetHostByName(myHost).AddressList[0].ToString();
     // Show IP
     this.textBox2.Text = (myIP);
    Your Done! Build it and it will show your IP :) I will add An Source Project

    Need a Tut Written in C#? Feel free to ask me
    This tut was brought to you by xXxStevenxXx of Blueshadowz

    Attached File  IP.rar   1.36MB   398 downloads



    #2 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 09 November 2009 - 08:30 PM

    You can't link to other IPB downloads from another site. They won't load unless logged in on that site.

    #3 Decatur

    Decatur

      I went from script kiddie to network engineer

    • Retired Staff

    • 2,475 posts
    • Joined: 26-July 08
    • Gender:Male
    • Location:Over there

    Posted 10 November 2009 - 02:29 PM

    ipconfig /all?

    #4 Lol5916

    Lol5916

      Recruit

    • Members

    • 1 posts
    • Joined: 27-June 10

    Posted 28 June 2010 - 11:50 AM

    Sorry to gravedig, but I fixed the code for VS10:
    string myIP = System.Net.Dns.GetHostEntry(myHost).AddressList[0].ToString();
    


    #5 Mila432

    Mila432

      Recruit

    • Members

    • 1 posts
    • Joined: 30-September 12

    Posted 30 September 2012 - 04:35 PM

    no one need the local ip...