Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

How can i find out from one of my app running on two separate machines that they are running on a particular machine

I want to run my client applications on different machines.
But when a new client application is run on new machine, i want to verify that the IP addresses i have are running my app or not.

Syed Irtaza Ali
Syed Irtaza Ali
1 Solution
I'm not entirely sure I know what you are asking, but if you want to restrict your app to only certain computers, then you need your app to be able to identify what the client computer is called.

Put the following declaration in a module...

Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _
      (ByVal lpBuffer As String, nSize As Long) As Long

Then do the following in Form_Load...

    Dim lng As Long
    Dim strComputerName As String

    lng = 256
    strComputerName = Space(lng)
    Call GetComputerName(strComputerName, lng)
    strComputerName = Left(strComputerName, lng)

You can then test strComputerName to see if it is in the list of acceptable clients.
Syed Irtaza AliLead Software ArchitectAuthor Commented:
how can i get the computer IP address if the users uses FileOpen dialog to select a file from a remote computer.
Hi nomehero,
This old question (QID 20567284) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now