473,850 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IPEndPoint

Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.

Regards

James
Nov 20 '05 #1
4 5692
"James Proctor" <ja**********@e bmis.co.uk> schrieb
Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.


The constructor is overloaded.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
James,

Try:

Dim IPHost As IPHostEntry = Dns.Resolve(m_s HostName)
Dim Aliases() As String = IPHost.Aliases
Dim Addr() As IPAddress = IPHost.AddressL ist

IPEndPoint = New IPEndPoint(Addr (0), 1000)

m_sHostName can be an IP address or URL.

Steve
-----Original Message-----
Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.

Regards

James
.

Nov 20 '05 #3
* "James Proctor" <ja**********@e bmis.co.uk> scripsit:
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.


There is an overloaded ctor available which expects an IP Address:

\\\
Public Sub New(IPAddress, Integer)
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
In article <06************ *************** *@phx.gbl>, James Proctor wrote:
Hi there, im trying to write a application that has some
socket stuff in. Ive only don socket stuff in vb 6
before. In .net i was using IPEndPoint and i want to
enter an ip address and port like so:

IPEndPoint = New IPEndPoint("192 .0.0.01",1000)

But its asking for the IPaddress to be a long. How do i
convert it or put in an IP address of my choice. Hope
someone can help me out.

Regards

James


Dim ep As IPEndPoint = New IPEndPoint( _
IPAddress.Parse ("192.0.0.01 "), 1000)

HTH
--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #5

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

Similar topics

5
11736
by: Terry | last post by:
It's my understanding of UDP sockets that if there is a thread blocked on a "recvFrom()" call and other thread sends a UDP packet to some address, that if the machine on the other end isn't up, that the "recvFrom()" call should just continue blocking. Right? What I'm seeing is that when I send a packet to a particular address that is not responding, my "recvFrom()" call throws an exception. I get "An existing connection was forcibly...
6
7009
by: Laxmikant Rashinkar | last post by:
Is there any way to use a C# socket in promiscuous mode? Any sample code that shows how this is done? any assistance is much appreciated! thanks LK
0
1253
by: Tim Mavers | last post by:
I am trying to use the ANTS Profiling service to profile a .NET web app (on my machine). I have XP SP2 with the Firewall turned off (my company's security policy sets this). I have talked to ANTS support, but they have no idea. The service is running and listening on port 8087 (as expected). I have tried connected with localhost, my machine name, my ip address, and always get the same error. The .NET web app runs fine and is also...
1
4416
by: BadOmen | last post by:
Hi, This is used in a FAQ and it works fine wile connecting to my computer but I want to connect to an other... Original code: Code: Private _IpEndPoint As New IPEndPoint(Dns.GetHostByName(Dns.GetHostName).AddressList(0), 5124)
4
3851
by: Rainer Queck | last post by:
Hi NG, what is wrong with the following code? Sender and Revceiver are of the Type IPEndPoint. //================= bool IsEqual = tlg.Receiver.Equals(aTlg.Sender); if(tlg.Receiver.Address == aTlg.Sender.Address) { if(tlg.Receiver.Port == aTlg.Sender.Port)
14
25296
by: DaTurk | last post by:
I am makeing a Multicast server client setup and was wondering what the difference is between Socket.Connect, and Socket.Bind. It may be a stupid question, but I was just curious. Because I tried a test, and I can't bind two sockets to the same port/ip but I can connect with one socket, and bind with another to the same ip/port. Thanks
0
2213
by: tccode97 | last post by:
To whom it may concern, I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient.beginreceive.aspx First of all, thanks for microsoft team for this post.
1
2529
by: tccode97 | last post by:
Hi, I need an urgent help. I am developing a socket application in VC++ that uses asynchronous connnection. After doing search on google, I found the following link http://msdn2.microsoft.com/en-us/library/system.net.sockets.udpclient...
5
9739
by: Markgoldin | last post by:
I am searching for a solution of sending messages from not .Net process into a .Net process written in C#. I have gone already thru sockets solution and have porblems with it. I am not a C# coder dont kill :) I am thinking about something like this: A remote non .Net process has a window with a name known to .Net program. Can .Net program somehow process that window using window's title and extracting a text from it? What other solutions...
0
9741
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
10666
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
10724
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
10349
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...
1
7899
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7070
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
5735
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
5929
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4545
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

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.