Я использую:
http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx#Y2160
для подключения и получения информации с сервера. Это мой код:
// Connect to the server
TcpClient^ client = gcnew TcpClient( "1.1.1.1", 45257 );
// Get stream
NetworkStream^ stream = client->GetStream();
// Data to send
array<Byte>^data = Text::Encoding::ASCII->GetBytes( message );
// Send data to server
stream->Write( data, 0, data->Length );
Однако я получаю следующие ошибки:
error C3083: 'Encoding': the symbol to the left of a '::' must be a type
error C2039: 'ASCII' : is not a member of 'System::Windows::Forms::Form::Text'
error C2065: 'ASCII' : undeclared identifier
error C2227: left of '->GetBytes' must point to class/struct/union/generic type
Это внутри формы Windows.
Любая помощь будет оценена. Спасибо