Chci se jen zeptat. V c# mam tuto metodu s parametrem a muzu ji volat bez parametru. volani:
_listener = new TcpListener(IPAddress.Any, 21);
_listener.Start();
_listener.BeginAcceptTcpClient(HandleAcceptTcpClient, _listener);
Definice:
private void HandleAcceptTcpClient(IAsyncResult result)
{
TcpClient client = _listener.EndAcceptTcpClient(result);
_listener.BeginAcceptTcpClient(HandleAcceptTcpClient, _listener);
// Delej neco
}
a to cele potrebuju dostat do Vb.net (ve vb.net spis zvladnu napsat neco tezsiho) mam zatim toto: volani:
_listener = New Net.Sockets.TcpListener(System.Net.IPAddress.Any, 21)
_listener.Start()
_listener.BeginAcceptTcpClient(HandleAcceptTcpClient, _listener)
Jenze tady je ta chyba. Chce to parametr "result" Definice:
Private Sub HandleAcceptTcpClient(ByVal result As IAsyncResult)
Dim client As System.Net.Sockets.TcpClient = _listener.EndAcceptTcpClient(result)
_listener.BeginAcceptTcpClient(HandleAcceptTcpClient, _listener)
End Sub
Poradi nekdo prosim?
|