[C#] dll

Badgott

Erfahrenes Mitglied
Hi ich habe hier ein Programm was bei mir auf meinem PC super läuft doch sobald ich es auf einem anderen PC starte wo kein .NET drauf ist will er von mir eine dll haben. kann mir da vieleicht jemand helfen vieleicht mache ich auch beim exe erstellen etwas falsch werden dort dlls mitgelifert wenn ich das Programm erstelle?

Code:
PHP:
TcpClient tcpClient = new TcpClient();
    try{
        tcpClient.Connect("www.contoso.com", 11000);
        NetworkStream networkStream = tcpClient.GetStream();

        if(networkStream.CanWrite && networkStream.CanRead){

            // Does a simple write.
            Byte[] sendBytes = Encoding.ASCII.GetBytes("Is anybody there");
            networkStream.Write(sendBytes, 0, sendBytes.Length);
      
            // Reads the NetworkStream into a byte buffer.
            byte[] bytes = new byte[tcpClient.ReceiveBufferSize];
            networkStream.Read(bytes, 0, (int) tcpClient.ReceiveBufferSize);
  
           // Returns the data received from the host to the console.
           string returndata = Encoding.ASCII.GetString(bytes);
           Console.WriteLine("This is what the host returned to you: " + returndata);

          }
          else if (!networkStream.CanRead){
              Console.WriteLine("You can not write data to this stream");
              tcpClient.Close();
          }
          else if (!networkStream.CanWrite){             
              Console.WriteLine("You can not read data from this stream");
              tcpClient.Close();
          }
       }
       catch (Exception e ) {
                  Console.WriteLine(e.ToString());
       }

MFG Badgott
 

Neue Beiträge

Zurück