View Ipv4 address
If you have completed an application and wish to share the complete source/project files with everyone then please post it in here. Source-code files only, no tutorials.
4 posts
Page 1 of 1
This is how to view your IPV4 Address. For those who don't know what that is or what that's used for, its your kinda other IP address that is the real thing that you don't want hackers or viruses to get a hold of because that way they can send you stuff or receive stuff (Spyware) and its used for tcp or any data sending or receiving. So I have been searching online for a while on how to get this so when you make a chat or IM you won't have to require the user for there IP or the other persons IP and i could not find one so i just wanted to make a quick tutorial on it 
So first we add a function
-Nocturnal

So first we add a function
Code: Select all
Next we are actually going to put the function in Play Function ReturnLocalIP(ByVal Type As Net.Sockets.AddressFamily) As String
'The Main function that will get the IPV4 for you
Dim HostEntry As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName)
For Each IP As Net.IPAddress In HostEntry.AddressList
If IP.AddressFamily = Type Then
Return IP.ToString
End If
Next
Return "NULL"
End Function
Code: Select all
I put Mines in my Form load but you can put it any where and in anything you can also edit the code to fit your needs Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'This is where you decrare where you want it to display the IP
TextBox1.Text = ReturnLocalIP(Net.Sockets.AddressFamily.InterNetwork)
End Sub
-Nocturnal
- Nocturnal
tisk tisk tisk http://community.xat.com/showthread.php ... sual-Basic
looks awfullly similiar
dude almost everything you put here is near virus related are you trying to get us banned for life
looks awfullly similiar
dude almost everything you put here is near virus related are you trying to get us banned for life
Bogoh67 wrote:tisk tisk tisk http://community.xat.com/showthread.php ... sual-Basicwhat do you mean virus and banned for life this is for tcp chatting only
looks awfullly similiar
dude almost everything you put here is near virus related are you trying to get us banned for life
- Nocturnal
That is your local ip, if you are using dsl connection it will return in 90% cases 192.168.x.x
This is how to get real ip :
This is how to get real ip :
Code: Select all
Imports System.IO
Imports System.Net
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyRequest As WebRequest = WebRequest.Create("http://whatismyip.org")
Dim MyResponse As WebResponse = CType(MyRequest.GetResponse, HttpWebResponse)
Dim MyReader As New StreamReader(MyResponse.GetResponseStream())
Dim MyContent As String = MyReader.ReadToEnd()
MyReader.Close()
MsgBox("Your ip address is : " + MyContent)
End Sub
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023