How do I check that a computer are a member of a sutain network????


I'm thinking of developing a peer 2 peer client. That should not be a problem. But its a p2p client who only should allow users working for my company. How do I see that the user are inside our LAN?

You probarbly know what I meen.

For points I'd like some code in java och C++ or something simular.

Peace. Mike
Who is Participating?

Improve company productivity with a Business Account.Sign Up

DreamMasterConnect With a Mentor Commented:
If the users are inside your lan, you can probably check them using their IP numbers....if the IP number is in a certain range....they are in your lan...

Indeed the IP address can be of use.

in java it would be something like using sockets.

ServerSocket server=new ServerSocket(1818);
Socket socket=server.accept();

The IP returned by getInetAddress should be checked against your LAN-ip numbers. Not for each and every one, just check for the boundaries in your domain.

The code above would be java specific. Though the WinSock object provides the same functionality.
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

just set up your firewall to only allow those from your group, based on IP address.

if you fon't have a firewall, try Zone Alarm, it's the best.
Micke_CapAuthor Commented:
It's true that I can use the IP adress when the user is inside our net but we have consultants that are outside out net aswell. Mayby I was'nt clear enough on that.

Ithink I have solved it by making a client based om my own protocol instead of gnutella. then I can make a client that has a built in crypted password.

Thank you guys for getting me on the right track...

If you have solved the problem could you please select one of the comments above as the answer, or delete the question? That will keep the unanswered questions list short :-)

If you want to scan for Lan, I'll support checking IP address. But as graham_k suggested...Zone Alarm is the best.It is free for "personal" use.

Are you using DHCP ?

For security you may try out servlets.

Have a look at:

and also some code on socket:

may be helpful.

Sorry I was little late...
servlets may be useful then...
Asta CuCommented:
Hopefully you've already been helped with this question, but thought you'd appreciate knowing this.  It would be great if you could bring this question to a conclusion, awarding the experts above who helped you with points or a comment to them on your status today.

WindowsUpdate has new updates for .NET users; Details follow - Microsoft .NET Framework
The .NET Framework is a new feature of Windows. Applications built using the .NET Framework are more reliable and secure. You need to install the .NET Framework only if you have software that requires it.

For more information about the .NET Framework, see (This site is in English.)

System Requirements
The .NET Framework can be installed on the following operating systems:
Windows 98
Windows 98 Second Edition (SE)
Windows Millennium Edition (Windows Me)
Windows NT 4.0® (Workstation or Server) with Service Pack 6.0a
Windows 2000 with the latest service pack installed (Professional, Server, Datacenter Server, or Advanced Server)
Windows XP (Home Edition and Professional)
You must be running Internet Explorer version 5.01 or later for all installations of the .NET Framework.

To install the .NET Framework, your computer must meet or exceed the following software and hardware requirements:

Software requirements for server operating systems:
MDAC 2.6
Hardware requirements:
For computers running only a .NET Framework application, Pentium 90 mHz CPU with 32 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 mHz CPU with 128 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
Recomended software:
MDAC 2.7 is recommended.
Recommended hardware: For computers running only a .NET Framework application, Pentium 90 MHz CPU with 96 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.
For server operating systems, Pentium 133 MHz CPU with 256 MB memory or the minimum CPU and RAM required by the operating system, whichever is higher.

How to use -> Restart your computer to complete the installation. No other action is required to run .NET Framework applications. If you are developing applications using the .NET Framework, you can use the command-line compilers or you can use a development environment, such as Visual Studio .NET, that supports using the .NET Framework.

How to uninstall
To uninstall the .NET Framework: Click Start, point to Settings, and then click Control Panel (In Windows XP, click Start and then click Control Panel.).
Click Add/Remove Programs.
Click Microsoft .NET Framework (English) v1.0.3705 and then click Change/Remove.
More here

The .NET topic is being considered for addition to our All Topics link soon, so this may interest you as well:

EXPERTS POINTS are waiting to be claimed here:



No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - Answered by: DreamMaster (100) CJ_S (100) graham_k (100)
Please leave any comments here within the
next seven days.


Finalized as proposed

graham_k your points are at:

CJ_S your points are at:


Community Support Moderator
Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.