Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,533 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,793 people online right now. Registration is fast and FREE... Join Now!




How to obtain the IP of my computer?

 
Reply to this topicStart new topic

How to obtain the IP of my computer?, In my application which is used by several users, I want to save in th

otikoti
19 Aug, 2008 - 01:57 AM
Post #1

New D.I.C Head
*

Joined: 19 Aug, 2008
Posts: 2

So, there is this application which is used by several users who do inserts in the data base. What I need is a function ore something by means of which I can save automatically in the data base the IP of the computer which made the insertion. I have no code for this and I don't have the slightest idea how it is done, please help!
User is offlineProfile CardPM
+Quote Post

dineeshd
RE: How To Obtain The IP Of My Computer?
19 Aug, 2008 - 03:03 AM
Post #2

D.I.C Addict
Group Icon

Joined: 30 Jun, 2008
Posts: 578



Thanked: 16 times
Dream Kudos: 575
My Contributions
Add these in imports section......
vb
Imports System.Net
Imports System.Net.Dns


Getting Local IP Address.....
vb
Dim strLocalHost As String
Dim IPList(25) As Net.IPAddress
strLocalHost = Dns.GetHostName()
IPList = GetHostEntry(strLocalHost).AddressList
MsgBox(IPList(0).ToString)

User is offlineProfile CardPM
+Quote Post

otikoti
RE: How To Obtain The IP Of My Computer?
21 Aug, 2008 - 12:34 AM
Post #3

New D.I.C Head
*

Joined: 19 Aug, 2008
Posts: 2

QUOTE(otikoti @ 19 Aug, 2008 - 02:57 AM) *

So, there is this application which is used by several users who do inserts in the data base. What I need is a function ore something by means of which I can save automatically in the data base the IP of the computer which made the insertion. I have no code for this and I don't have the slightest idea how it is done, please help!





QUOTE(otikoti @ 19 Aug, 2008 - 02:57 AM) *

So, there is this application which is used by several users who do inserts in the data base. What I need is a function ore something by means of which I can save automatically in the data base the IP of the computer which made the insertion. I have no code for this and I don't have the slightest idea how it is done, please help!



I want to notice that I'm using Visual Studio 2003, and it gives me the message that the func GetHostEntry is not declared. I want to point out too that I don't need the IP of the localhost which I know is 127.0.0.1, I want the IP that the computer has in the LAN.
Thnx!
User is offlineProfile CardPM
+Quote Post

dineeshd
RE: How To Obtain The IP Of My Computer?
21 Aug, 2008 - 01:12 AM
Post #4

D.I.C Addict
Group Icon

Joined: 30 Jun, 2008
Posts: 578



Thanked: 16 times
Dream Kudos: 575
My Contributions
Check these posts.... smile.gif

http://www.dreamincode.net/code/snippet1121.htm

http://www.dreamincode.net/forums/showtopic10830.htm

http://www.dreamincode.net/forums/showtopic11152.htm
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 10:09PM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month