none
How to get DHCP auto configured value for NetBIOS over tcp/ip ? RRS feed

  • Question

  • Hi all,

    Configuration : Windows 7 Embedded Standard 32-bit

    The NetBIOS over Tcpip is  set to default, i.e. It will use the DHCP value.

    When hiting "ipconfig /all", I can see:

    NetBIOS over Tcpip. . . . . . . . : Enabled

    So, that means that the NetBIOS over Tcpip is auto configured to "Enabled" by the DHCP.

    Now, I would like to retrieve this auto configured value, programatically in C#.

    The TcpipNetbiosOptions properties of the Win32_NetworkAdapterConfiguration class does not help since it returns the option value.

    Thank you for your help.

    Regards,

    Ruben.


    -Ruben-

    mardi 20 novembre 2012 09:24

Réponses

  • Hello,

    This is a french forum. If you have NETBIOS at enabled, it's appear you're using your DHCP server as WINS (NETBIOS).

    If you want the IP address you should add it manualy in your config or set it on DHCP Server Options.

    NETBIOS is a protocol which broadcast packets to ask who's on your network.

     

    For getting your NETBIOS servers you can use this code :

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Net.NetworkInformation;
    using System.Net;
    
    namespace GetIPCONFIG
    {
        class Program
        {
            static void Main(string[] args)
            {
                if (NetworkInterface.GetIsNetworkAvailable())
                {
                    foreach (NetworkInterface nIF in NetworkInterface.GetAllNetworkInterfaces())
                    {
                        foreach (IPAddress ip in nIF.GetIPProperties().WinsServersAddresses)
                        {
                            Console.WriteLine(ip.ToString());
                        }
                    }
                }
                
            }
        }
    }
    
    But you will get empty ip if u didn't set Wins Option on DHCP server.


    Merci de valider par "Proposer comme réponse" si celle-ci répond à votre demande !

    • Marqué comme réponse Aurel Bera lundi 26 novembre 2012 09:26
    mardi 20 novembre 2012 10:00

Toutes les réponses