473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Equivalent of VB6 Winsock control in C#

What is the equivalent of the VB6 Winsock control in C#? I'm looking at
converting some code from VB6 to C# (see below). Does anybody know how
I would do this?

tcpSendData.RemoteHost = "10.0.4.2" 'test
tcpSendData.RemotePort = 1024 'Set port

'Invoke the Connect method to initiate connection
tcpSendData.Connect
Any assistance would be really appreciated.
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
2 7907
Mike -

you can use System.Net.Sockets.Socket class. More info and an exmple is
available at
http://msdn.microsoft.com/library/de...classtopic.asp

Cheers,
Branimir

--
Branimir Giurov
MCSD.NET, MCDBA
www.sofiadev.org

"Mike P" <mr*@telcoelectronics.co.uk> wrote in message
news:uB*************@TK2MSFTNGP12.phx.gbl...
What is the equivalent of the VB6 Winsock control in C#? I'm looking at
converting some code from VB6 to C# (see below). Does anybody know how
I would do this?

tcpSendData.RemoteHost = "10.0.4.2" 'test
tcpSendData.RemotePort = 1024 'Set port

'Invoke the Connect method to initiate connection
tcpSendData.Connect
Any assistance would be really appreciated.
Cheers,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2
You can use the TcpClient class, if you need anything else network related,
check the System.Net and System.Net.Sockets namespaces.

Etienne Boucher
Nov 16 '05 #3

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

Similar topics

8
by: C. Alexander | last post by:
Im running a small server that seems to work fine outside the IDE as an exe, but within the IDE, when I run the program for the first time, i can start/stop the host many times. But I end the...
4
by: Ophir | last post by:
Hello all ! I wrote a simple ActiveX DLL to wrap winsock functionality so I can use it in an ASP page. I call it MyWinSock In the Class module I use this declaration: Dim ctlSocket as...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
3
by: John | last post by:
Hello, I currently have Visual Basic .NET 2003 Standard Edition. I would like to develop a standard exe which should use the Winsock Control for VB.NET. I found some tutorials about it, started...
5
by: Daniel | last post by:
Hi group, In VB6 if I wanted my app to listen on a specific IP port I used the Winsock control along with the great example code on MSDN. Now, for .NET I assume that there is a class for this....
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
2
by: Mark | last post by:
Hi, I have a VB6 project that uses a winsock control to receive text messages over a UDP connection. It used to work fine. However, when I changed the code to make it more efficient (ie, less...
1
by: kimiraikkonen | last post by:
Hi, As you know there's no mswinsck.ocx ActiveX control in VB.NET 2005 or 08 by default, but it exists in VB6. However i can add this old control to my VB 2005 toolbox with no problem by...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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,...
0
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...
0
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,...
0
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...

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.