C# & mswinsock.ocx
-
Hi guys, This activex control has optionals parameters for GetData method: this.axWinsock1.GetData(ref object data,object type,object maxlen) i tried these: object rec= string.Empty; object type = 0; object maxlen = 0; this.winsock.GetData(ref rec, type, maxlen); or object rec= string.Empty; object type = string.Empty; object maxlen = string.Empty; this.winsock.GetData(ref rec, type, maxlen); but all i get is "Unsupported variant types" error message, do you know how to call this getdata method in c#? i know if you call it in vb.net you dont need to pas optional parameteres. Please help:confused:
-
Hi guys, This activex control has optionals parameters for GetData method: this.axWinsock1.GetData(ref object data,object type,object maxlen) i tried these: object rec= string.Empty; object type = 0; object maxlen = 0; this.winsock.GetData(ref rec, type, maxlen); or object rec= string.Empty; object type = string.Empty; object maxlen = string.Empty; this.winsock.GetData(ref rec, type, maxlen); but all i get is "Unsupported variant types" error message, do you know how to call this getdata method in c#? i know if you call it in vb.net you dont need to pas optional parameteres. Please help:confused:
Don't use this control in C#. Instead, use the
System.Net.Sockets.Socket
class, or theTcpClient
,UdpClient
,TcpListener
classes which are a little more friendly to use. The data you get from the socket will be in raw bytes. You will need to use one of theSystem.Text.Encoding
classes to turn text from the byte-oriented wire format into astring
. As a starting point, tryEncoding.Default
.Stability. What an interesting concept. -- Chris Maunder