473,789 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connected to network or peer-to-peer?

Hello,

is there a simple way to detect whether the host machine of my c#
application is connected to a windows network or whether it is connected
peer-to-peer simply to one other machine (IP-adress unknown)?

My first try would be to find typical UDP broadcasts within a certain period
of time. If there are no such broadcast packages then I could assume that it
is a peer-to-peer connection otherwise it is a windows network.

But I guess this is not reliable, isn't it?

Any tipps or suggestions?

Thanks!
Jan 16 '06 #1
2 1472
I wouldn't think that you would need to get that complicated about it. I
would just query network properties to see if I am part of a workgroup or
part of a domain. This way, I wouldn't have to worry about protocols
(TCP/IP, IPX/SPX, etc)

I would most likely use wmi to query this.
"Michael Bauer" <Ba********@hot mail.com> wrote in message
news:%2******** *********@TK2MS FTNGP09.phx.gbl ...
Hello,

is there a simple way to detect whether the host machine of my c#
application is connected to a windows network or whether it is connected
peer-to-peer simply to one other machine (IP-adress unknown)?

My first try would be to find typical UDP broadcasts within a certain
period of time. If there are no such broadcast packages then I could
assume that it is a peer-to-peer connection otherwise it is a windows
network.

But I guess this is not reliable, isn't it?

Any tipps or suggestions?

Thanks!

Jan 16 '06 #2
http://gethelp.devx.com/techtips/nt_...inNT1101-2.asp

"AMDRIT" <am****@hotmail .com> wrote in message
news:eX******** ******@TK2MSFTN GP15.phx.gbl...
I wouldn't think that you would need to get that complicated about it. I
would just query network properties to see if I am part of a workgroup or
part of a domain. This way, I wouldn't have to worry about protocols
(TCP/IP, IPX/SPX, etc)

I would most likely use wmi to query this.
"Michael Bauer" <Ba********@hot mail.com> wrote in message
news:%2******** *********@TK2MS FTNGP09.phx.gbl ...
Hello,

is there a simple way to detect whether the host machine of my c#
application is connected to a windows network or whether it is connected
peer-to-peer simply to one other machine (IP-adress unknown)?

My first try would be to find typical UDP broadcasts within a certain
period of time. If there are no such broadcast packages then I could
assume that it is a peer-to-peer connection otherwise it is a windows
network.

But I guess this is not reliable, isn't it?

Any tipps or suggestions?

Thanks!


Jan 16 '06 #3

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

Similar topics

3
7547
by: hilz | last post by:
Hi all: I have an oracle 9i server running behind a firewall. i set up the machine that has the oracle server as a DMZ zone. i can connect to the oracle server from the local network but not from outside (using the oracle THIN driver) can anyone tell me what is the problem and how to solve it? thanks
0
2289
by: Baihao Yuan | last post by:
Hello, I have a machine, which has two network cards, network card 1 and network card 2, they are on different subnetworks. The IP address of network card 1 is 192.0.0.1, the IP address of network card 2 is 192.0.0.2. The question is: Can the SQL server accept the connections(TCP/IP protocol) from the two network cards?
2
2597
by: stanley j Mroczek | last post by:
Every thing is on one machine, Programs and sql. Sql is up and running(can test with query analyzer). No changes where made! This was working fine. How do you track this error? What network documentation? Nothing shows in the event viewer. where do I start? General network error. Check your network documentation. Description: An unhandled exception occurred during the execution of the current web request. Please review the
6
9744
by: moonriver | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare...
1
971
by: PeterNZ | last post by:
Hi all, I developped an C# app which is using FileSystemWatcher. If a file is created in a specific folder, it opens the file and does some processing. This functionality works without problems in the following scenarios: In a Winform App, pointing at a Local Folder In a Winform App, pointing at a mapped network Folder In a Winform App, pointing at a UNC network location In a Windows Service pointing at a local Folder.
9
1984
by: mikharakiri_nospaum | last post by:
I have graph x y - - 1 2 2 3 3 1 4 5 and would like to query how many connected components it has (two in the example -- {1,2,3} and {4,5}). Is it doable with "recursive with"?
5
1728
by: Corrine | last post by:
Given a backend on a network server and a frontend on a local computer, when is data pulled across the network? For example, does Rst.Recordcount pull data across the network? How about Rst.Findfirst? When a form or report opens, do they pull all the data in the recordsource across the network? Thank you for your help! Corrine
3
2149
by: u473 | last post by:
.... Or, How do you identify connected users ? Help appreciated. Celeste Edwards,
1
2399
by: Daniel Xiao | last post by:
I write a program accessing files in network drive o:. It is doable as a standalone application. However, if it is running under windows service, the following exception will appear: 13/07/2004 10:24:48 AM run() error: System.IO.IOException: The specified network password is not correct. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare...
1
1076
by: Kristijan Marin | last post by:
Hi, I have a project where components/programs run on different mashines ... and data exchange and execution of some actions on server side is done with help of webservice .... Now the same code for accessing server side can be called from some application installed inside local network( Office location) or outside this network( Home location) .....
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10200
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9984
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.