Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.59 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Using Text Encoding in C  /CLI
  2. // Connect to the server
  3. TcpClient^ client = gcnew TcpClient( "1.1.1.1", 45257 );
  4.  
  5. // Get stream
  6. NetworkStream^ stream = client->GetStream();
  7.  
  8. // Data to send
  9. array<Byte>^data = Text::Encoding::ASCII->GetBytes( message );
  10.  
  11. // Send data to server
  12. stream->Write( data, 0, data->Length );
  13.        
  14. error C3083: 'Encoding': the symbol to the left of a '::' must be a type
  15. error C2039: 'ASCII' : is not a member of 'System::Windows::Forms::Form::Text'
  16. error C2065: 'ASCII' : undeclared identifier
  17. error C2227: left of '->GetBytes' must point to class/struct/union/generic type