473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ping without using raw sockets

Is there a way in VB.Net to implement ping functionality
without using raw sockets?
I cannot use raw sockets because it has been
locked/disabled for security reasons.

Thanks

Rudolf

Nov 20 '05 #1
3 2235
Just as an update for more info. When creating a socket of
Icmp type for ping the SocketType is set to raw in the
sample I have. However setting it to something else cause
the socket creation to fail.

e.g.
ICMPSocket = New Socket(AddressF amily.InterNetw ork,
SocketType.Raw, ProtocolType.Ic mp)

Rudolf
-----Original Message-----
Is there a way in VB.Net to implement ping functionality
without using raw sockets?
I cannot use raw sockets because it has been
locked/disabled for security reasons.

Thanks

Rudolf

.

Nov 20 '05 #2
On 2003-11-05, Rudolf <ru*****@hotmai l.com.donotspam meandsoon> wrote:
Is there a way in VB.Net to implement ping functionality
without using raw sockets?
I cannot use raw sockets because it has been
locked/disabled for security reasons.

Thanks

Rudolf


Well, there are a couple of ways that come to mind. You could use the
System.Diagnost ics.Process class to call the windows ping program in the
back ground and redirect it's output so that you can read and parse the
results...

Another method maybe to use P/Invoke to call the Icmp helper functions
to perform the ping. I used to have a VB.NET sample of this that I put
together from some VB6 code I found, but for the life of me - I can't
find it. It maybe at work, so I will check tomorrow and post back...

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #3
Thanks, If you can it would be appreciated.

Rudolf
-----Original Message-----
On 2003-11-05, Rudolf <ru*****@hotmai l.com.donotspam meandsoon> wrote:
Is there a way in VB.Net to implement ping functionality without using raw sockets?
I cannot use raw sockets because it has been
locked/disabled for security reasons.

Thanks

Rudolf


Well, there are a couple of ways that come to mind. You

could use theSystem.Diagnos tics.Process class to call the windows ping program in theback ground and redirect it's output so that you can read and parse theresults...

Another method maybe to use P/Invoke to call the Icmp helper functionsto perform the ping. I used to have a VB.NET sample of this that I puttogether from some VB6 code I found, but for the life of me - I can'tfind it. It maybe at work, so I will check tomorrow and post back...
--
Tom Shelton
MVP [Visual Basic]
.

Nov 20 '05 #4

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

Similar topics

4
2990
by: Philipp Plaenitz | last post by:
hello, is out there any tutorial for writting a c/cpp program, that can ping an other computer WITHOUT having suid state. for the moment i only get working raw socket as root. many thanx
17
18202
by: wana | last post by:
I was reading through original source code of ping for some insight and was confused by unusual code. Entire listing available at: http://www.ping127001.com/pingpage/ping.html #include #include #include #include #include #include #include #include #include #include #include #include
2
10200
by: Tim C | last post by:
Is there a way to do a Ping from C# if you are not logged in as administrator on W2k? I am trying to do a Ping from C# running under ASP.NET. I have found several examples on the web, mostly derived from Lance Olson's code. The examples use raw sockets and I get a permissions error: "An attempt was made to access a socket in a way
2
5603
by: Eric Wenger | last post by:
I'm pretty new to C# and I'm trying to do what I believe should be a simple thing. I want to modify a program that is using the System.Net.NetworkInformation.Ping class to have some custom behavior. For example I would like to do a "TCP-ping" where I try to connect to a TCP port on a remote machine. It seems obvious to me that I should try to derive a new Ping class (TCPPing) from the existing class so that I can use its interfaces. ...
24
20426
by: Rudolf | last post by:
Is there a way to do a plain ping operation in VB.Net using only .Net libraries? Thanks Rudolf
0
7779
by: Ed | last post by:
I've attached some VB.NET code I've hacked together (some taken from MS examples & newsgroup postings) that will perform a ping or IcmpSendEcho using the icmp.dll (see this for more info: http://support.microsoft.com/default.aspx?scid=kb;en-us;170591 ). The problem I have is in order to perform a discovery/ping of an entire subnet (192.168.1.* for instance) I have to do a FOR loop to itterate through all of the addresses. That it seems...
8
9809
by: TKowalcz | last post by:
Hello. I have a problem. I need to make a client-server application using sockets (easy). After they communicate server store information about client (IP, and some data). Later on i need to check if the client is connected (ive got his IP and need to ping him). I dont need to write whole ping function - just need a return value :). Ive googled but didnt find anything :(. Could someone help - how can i
4
13199
by: =?Utf-8?B?QWxleCBLLg==?= | last post by:
Hi all I need a simple program that allows me to check if an IP address is pingable. I am not going to send/receive anything to the remote host, just check if it is visible. Something like this: private bool CheckIPAddress(string address) { if (Ping(address))
4
2240
by: Newbie | last post by:
Is it possible, without any 3rd party tools to simply ping an ip address, and get back if the ping was sucessfull. Thanks
0
8752
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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...
1
9176
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
4519
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
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
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
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.