Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Get IP From Hostname

Posted on September 23, 2013October 26, 2015 By David Kittell
  1. Create a new project
  2. Add a TextBox and name it “txtHostname”
  3. Add another TextBox and name it “txtIP”
  4. Add a button and name it “btnResolve” and give it appropriate text like “Resolve IP”
  5. Double click on the button to auto generate the button action code and insert code as shown below
Imports System.Net

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnResolve.Click
		Dim hostname As IPHostEntry = Dns.GetHostByName(txtHostname.Text)

		Dim ip As IPAddress() = hostname.AddressList

		txtIP.Text = ip(0).ToString()
End Sub
End Class
Originally Posted on September 23, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code VB.NET

Post navigation

Previous post
Next post

Related Posts

Folder Delete Everything

Posted on December 14, 2013October 26, 2015

Careful with this function as it can really do some serious damage if you choose the wrong folder. ‘Folder Delete Everything – Start Private Sub DeleteDirectory(ByVal dir_name As String) Try Dim file_name As String Dim files As Collection Dim i As Integer ‘ Get a list of files it contains….

Read More

Hide/Unhide Element Via ID

Posted on June 12, 2013October 26, 2015

In this code it is important to have visibility = ‘hidden’ and display = ‘none’ to hide without leaving white space function off(i) { document.getElementById(i).style.visibility = ‘hidden’; document.getElementById(i).style.display = ‘none’; } In this code it is important to have visibility = ” and display = ” to show function on(i)…

Read More

SharePoint Web Service

Posted on September 10, 2015

Microsoft SharePoint offers a web service to query and use to simplify jobs that typically you’d have to need a connection to active directory. Some Basic URLs: http://(Your SharePoint URL)/_vti_bin/UserProfileService.asmx http://(Your SharePoint URL)/_vti_bin/Lists.asmx http://(Your SharePoint URL)/_vti_bin/UserGroup.asmx From within http://(Your SharePoint URL)/_vti_bin/UserProfileService.asmx you can pull these details UserProfile_GUID, AccountName, FirstName, LastName,…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes