Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Using Text Encoding in C /CLI
- // 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
Advertisement
Add Comment
Please, Sign In to add comment