473,548 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Obtain IP address via VBA ?

HB2
Is it possible to obtain the IP address of my desktop using a Visual Basic
command?
Nov 13 '05 #1
5 23054
On Sun, 12 Dec 2004 23:02:48 GMT, "HB2" <bg******@comca st.net> wrote:

The desktop doesn't have an IP address. It has a window handle, if
that's what you want.
"localhost" is the generic name of the local web server, and its
address per definition is 127.0.0.1

-Tom.

Is it possible to obtain the IP address of my desktop using a Visual Basic
command?


Nov 13 '05 #2

"HB2" <bg******@comca st.net> wrote in message
news:n64vd.6471 07$mD.275603@at tbi_s02...
Is it possible to obtain the IP address of my desktop using a Visual Basic
command?


You mean your desktop computer?

You can use the winsock control, and it takes a bit of setup. There's a
newsgroup, alt.winsock I think, that can probably point you to some sample
code.
Nov 13 '05 #3
Try:

http://www.mvps.org/access/api/api0067.htm
On Sun, 12 Dec 2004 23:02:48 GMT, "HB2" <bg******@comca st.net> wrote:
Is it possible to obtain the IP address of my desktop using a Visual Basic
command?

*************** *******
ja************* *@telusTELUS.ne t
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
Nov 13 '05 #4
You may need the following as well

Private Declare Function GetComputerName Lib "kernel32" Alias
"GetComputerNam eA" ( _
ByVal lpBuffer As String, _
nSize As Long _
) As Long

Private Const MAX_COMPUTERNAM E_LENGTH = 31

Function ThisComputerNam e() As String
Dim lpBuffer As String
Dim nSize As Long
Dim lngRet As Long

nSize = MAX_COMPUTERNAM E_LENGTH + 1
lpBuffer = Space(nSize)
lngRet = GetComputerName (lpBuffer, nSize)
If lngRet <> 0 Then
ThisComputerNam e = Left(lpBuffer, nSize)
End If
End Function

You can then call
Dim strIP as string

strIP = fGetHostIPAddre sses(ThisComput erName)(1)

which should give you the IP address of the computer you are on.
--
Terry Kreft
MVP Microsoft Access
"Jack MacDonald" <ja************ **@telus.net> wrote in message
news:30******** *************** *********@4ax.c om...
Try:

http://www.mvps.org/access/api/api0067.htm
On Sun, 12 Dec 2004 23:02:48 GMT, "HB2" <bg******@comca st.net> wrote:
Is it possible to obtain the IP address of my desktop using a Visual Basiccommand?

*************** *******
ja************* *@telusTELUS.ne t
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security

Nov 13 '05 #5
On Sun, 12 Dec 2004 23:02:48 GMT, "HB2" <bg******@comca st.net> wrote:
Is it possible to obtain the IP address of my desktop using a Visual Basic
command?

Hi
If you want the external (WAN) address in general you have to find it
from outside your own environment, see for example the freeware
program MyWANIP
http://www.mywanip.com/

You can use this to put the address on the clipboard.
David
Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
21278
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of someone (client) that visits a web site through an anonymous proxy if this person ONLY has JavaScript enabled in their browser? This is NOT a...
5
6659
by: Jeronimo Bertran | last post by:
Hello, We have developed a socket tcpip server in .net that accepts calls from clients. Using the connected socket we are able to use the Socket.RemoteEndPoint to obtain the IP address of the client. Is there any way to obtain the MAC address for the client? Thanks Jeronimo
22
2426
by: ypjofficial | last post by:
Hello All, While readling the C and C++ literature i came to know that the OS allocates separate protected memory space for each running program and the program do not interfare into one another's address space. Also the address space allocated for each program is totally relative. Now i want to know that from what address value does the...
33
3129
by: baumann.Pan | last post by:
hi all, i want to get the address of buf, which defined as char buf = "abcde"; so can call strsep(address of buf, pointer to token);
4
2658
by: Ed Willis | last post by:
We have several offices that have a DSL or Cable modem where the IP address is dynamic and changes often. I created a VB app that obtains the IP address but it obtains the IP address within the firewall and we need the public IP address of the machine outside the firewall so we can use Remote Desktop connection for problem resolution etc. ...
4
4162
by: stuff | last post by:
Is it possible to obtain the client's ip address from a SimpleXMLRPCServer instance or subclass instance? When running SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out the fqdn on the console, however, I'm not sure if this information (either fqdn or ip address) is available to the SimpleXMLRPCServer instance. Can...
0
1208
by: ngr | last post by:
I want to be able to retrieve an ip address: At the moment I have to do the following OBTAIN A DOS WINDOW ROUTE PRINT From this I obtain the IP Address from the dos window thus.... Network Destination Netmask Gateway Interface Metric 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
5
2523
by: Peggy | last post by:
Hello, I have a web application running on IIS, What I wanna do is to obtain server's ethernet card's mac address in order to use this address for licensing issues I have developed my web app on vs.net 2005 +
7
3311
by: Brian Cryer | last post by:
What I'm looking for is a way to tell if two sessions are from the same physical PC or from different PCs (within the same organisation say). This is with the view to possibly enforcing license restrictions, i.e. limiting the number of pcs that user account can connect from (say to 1 perhaps 2) but not the number of open sessions that user can...
0
1560
by: leonardo.schmidt | last post by:
Due to some connectivity problems with a client's VPN software, I'm developing an app that needs to obtain the current logged user's Exchange server address & add a new route (among other well-known ones) to it in the computer's table, so Outlook 2003 can work properly. Is there any easy way to obtain that address (maybe without using...
0
7438
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.