Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

C# IP Address Control

cazan_ncazan_n Member Posts: 3
I cannot find IP Address Control in C#. Anybody cand help me? I try to import this control from an older library, comctl32,dll or ocx, but it said that is incompatible with .NET platform. I can make my own control, but first I want to know if it exist on .NET.

Also, I want find a way to receive TCP/IP settings from my local computer (some functions or some structure if there are any).

Thank you.

Comments

  • adi_clepceaadi_clepcea Member Posts: 4
    Hi,

    To convert an older control (like ocx) in and .net compatible dll you have to use tlbImp.exe. this is a tool that comes with .net framework.

    If you want to obtain the address of a computer you could use something like this:
    **********************
    IPHostEntry hServer = Dns.GetHostByName("computername");
    for(int i=0;i<hServer.AddressList.Length;i++){
    MessageBox.Show(hServer.AddressList[i].ToString());
    }
    **********************

    if you want to get the address of the computer your program runs on you just replace computername with :Dns.GetHostName(); so your program will show something like this:

    ************************
    IPHostEntry hServer = Dns.GetHostByName(Dns.GetHostName());
    for(int i=0;i<hServer.AddressList.Length;i++){
    MessageBox.Show(hServer.AddressList[i].ToString());
    }
    ************************
    HTH
    Adi

    : I cannot find IP Address Control in C#. Anybody cand help me? I try to import this control from an older library, comctl32,dll or ocx, but it said that is incompatible with .NET platform. I can make my own control, but first I want to know if it exist on .NET.
    :
    : Also, I want find a way to receive TCP/IP settings from my local computer (some functions or some structure if there are any).
    :
    : Thank you.
    :

  • cazan_ncazan_n Member Posts: 3
    Multumesc Adi, sper sa imi mearga :)

    : Hi,
    :
    : To convert an older control (like ocx) in and .net compatible dll you have to use tlbImp.exe. this is a tool that comes with .net framework.
    :
    : If you want to obtain the address of a computer you could use something like this:
    : **********************
    : IPHostEntry hServer = Dns.GetHostByName("computername");
    : for(int i=0;i<hServer.AddressList.Length;i++){
    : MessageBox.Show(hServer.AddressList[i].ToString());
    : }
    : **********************
    :
    : if you want to get the address of the computer your program runs on you just replace computername with :Dns.GetHostName(); so your program will show something like this:
    :
    : ************************
    : IPHostEntry hServer = Dns.GetHostByName(Dns.GetHostName());
    : for(int i=0;i<hServer.AddressList.Length;i++){
    : MessageBox.Show(hServer.AddressList[i].ToString());
    : }
    : ************************
    : HTH
    : Adi
    :
    : : I cannot find IP Address Control in C#. Anybody cand help me? I try to import this control from an older library, comctl32,dll or ocx, but it said that is incompatible with .NET platform. I can make my own control, but first I want to know if it exist on .NET.
    : :
    : : Also, I want find a way to receive TCP/IP settings from my local computer (some functions or some structure if there are any).
    : :
    : : Thank you.
    : :
    :
    :

  • adi_clepceaadi_clepcea Member Posts: 4

    Cu placere! ;)

    : Multumesc Adi, sper sa imi mearga :)
    :
    : : Hi,
    : :
    : : To convert an older control (like ocx) in and .net compatible dll you have to use tlbImp.exe. this is a tool that comes with .net framework.
    : :
    : : If you want to obtain the address of a computer you could use something like this:
    : : **********************
    : : IPHostEntry hServer = Dns.GetHostByName("computername");
    : : for(int i=0;i<hServer.AddressList.Length;i++){
    : : MessageBox.Show(hServer.AddressList[i].ToString());
    : : }
    : : **********************
    : :
    : : if you want to get the address of the computer your program runs on you just replace computername with :Dns.GetHostName(); so your program will show something like this:
    : :
    : : ************************
    : : IPHostEntry hServer = Dns.GetHostByName(Dns.GetHostName());
    : : for(int i=0;i<hServer.AddressList.Length;i++){
    : : MessageBox.Show(hServer.AddressList[i].ToString());
    : : }
    : : ************************
    : : HTH
    : : Adi
    : :
    : : : I cannot find IP Address Control in C#. Anybody cand help me? I try to import this control from an older library, comctl32,dll or ocx, but it said that is incompatible with .NET platform. I can make my own control, but first I want to know if it exist on .NET.
    : : :
    : : : Also, I want find a way to receive TCP/IP settings from my local computer (some functions or some structure if there are any).
    : : :
    : : : Thank you.
    : : :
    : :
    : :
    :
    :

Sign In or Register to comment.