.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

how to get input for ip address??

Posted By: manish     Posted Date: May 30, 2011    Points:5   Category :VB.Net
i m wrking on a window application...and i dont know how to get a input for ip address..
which textbox is used for that??
also validation for that??

Author: Sunil Yadav       [Moderator]      
Posted Date: May 30, 2011     Points: 20   


There is no special input box for IP address.

You can use TextBox from toolbox and \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b regex expression for IP address validation.

Author: manish             
Posted Date: May 31, 2011     Points: 20   

thanks but i didnt get the textbox in the toolbox...can u plzz name that textbox???

Author: Sunil Yadav       [Moderator]      
Posted Date: May 31, 2011     Points: 20   
Author: manish             
Posted Date: June 01, 2011     Points: 20   

thanks for the link but this is not enough helpful for me...i think there is a masked textbox which we used for ip addresss input...but that also dnt work in my .net framework...help me in that please...

Author: Gowthammanju             
Posted Date: June 02, 2011     Points: 20   


why u r validating the textbox for ip address ! better u can automatically retrive the ip address and computer name in ur application.
It provides u high security

note the code below

using System.Net;

Private string GetIP()
string HostName = "";
HostName = System.Net.Dns.GetHostName();

IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(HostName);

IPAddress[] addr = ipEntry.AddressList;

return addr[addr.Length-1].ToString();


Thanks & Regards,

Mark if the answer is true

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend