Breaking News
Loading...
Sunday 6 July 2014

How to get ip address of the all LAN computers.






Download Project : GetNetworkIpAddress.zip
To get the ip address of the all the computer which is connected to the local area network .
C#.net code:

·         there is a way to get ip address there is dll also available which is returns the ip address and computer name which is connecter to your network.
·         Download DLL From :  GetLaneIpAddress_Nirav_Daraniya
                How to use DLL in your application
a.       First take one windows form, and then drag and drop the button control to it and also list box control to form control.
b.      Now add dll to the project, this DLL is can not take any argument but its class name is “Class1” and it will return the Hash table.
c.       Code:
Add namespace in project
Imports GetLaneIpAddress_Nirav_Daraniya

Make object of the class which is define in DLL

Dim objClass1 As New Class1

Now generate button click event on your project
private void button1_Click(object sender, EventArgs e)
         {
       
              Dim aaaa As Hashtable
              aaaa = sss.getIPAddress()

              Foreach DictionaryEntry child In aaaa
{
ListBox1.Items.Add("PC Name : " + child.Key + "   IP Address : " + child.Value)

              }

        'ListBox1.Items.AddRange(geti.ToArray)
         }


             *** if you want to do same possess via code then follow this steps.

1.       first you have to a namespace
              using System.IO;
using System.Net;
using System.Net.NetworkInformation;

2.       now .
                         Process netUtility = new Process();

            netUtility.StartInfo.FileName = "net.exe";

            netUtility.StartInfo.CreateNoWindow = true;

            netUtility.StartInfo.Arguments = "view";

            netUtility.StartInfo.RedirectStandardOutput = true;

            netUtility.StartInfo.UseShellExecute = false;

            netUtility.StartInfo.RedirectStandardError = true;

            netUtility.Start();



StreamReader streamReader =StreamReader(netUtility.StandardOutput.BaseStream,                       netUtility.StandardOutput.CurrentEncoding);



3.       now make loop
                                string line = "";

              while ((line = streamReader.ReadLine()) != null)
              {
                if (line.StartsWith("\\"))
                {
                   
string myIP = Convert.ToString(System.Net.Dns.GetHostByName(line.Substring(2).Substring(0, line.Substring(2).IndexOf(" ")).ToUpper()).AddressList[0].ToString());
listBox1.Items.Add(myIP);
                }
              }

            streamReader.Close();
            netUtility.WaitForExit(1000);



See Also :
  Follow Me On Facebook

--
/\/ir@\/  <(.'.)>

17 comments:

  1. Thanks for sharing.
    It helped me lot.

    ReplyDelete
  2. The salary of nurses in Australia is influenced by various factors, including experience, qualifications, and the specific healthcare setting in which they work. On average, registered nurses earn between AUD 65,000 and AUD 85,000 annually. However, specialised roles such as nurse practitioners or critical care nurses can command salaries exceeding AUD 100,000. Geographic location also plays a significant role, with nurses in metropolitan areas typically earning more due to higher demand and living costs. Additional benefits, including shift allowances and overtime pay, enhance overall earnings. The Australian healthcare system's emphasis on professional growth and development further allows nurses to increase their earning potential over time. Overall, the compensation structure in Australia reflects the crucial role that nurses play in providing quality healthcare. As a result, nursing remains a rewarding career choice in terms of both financial and personal satisfaction.
    https://www.dynamichealthstaff.com/how-much-do-nurses-get-paid-in-australia

    ReplyDelete

Thanks for comment

 
Toggle Footer