title: Tell constructor im using task without telling which method
body: <p>I want to define a task (or thread) in my constructor, but start the task (or thread) with its method in a button-event.</p>
  
  <p>So I want something like this: </p>
  
  <pre><code>Task SendTask = Task.Factory.StartNew(());
  private void SendFilesButton_Click(object sender, EventArgs e)
  {
      SendTask.Sendfiles();
  }
  </code></pre>
  
  <p>My Method:</p>
  
  <pre><code>public void SendFiles()
  {
      try
      {
          tcpClient = tcpListener.AcceptTcpClient();
          if (tcpClient.Connected)
          {
  
              using (StreamReader reader = new StreamReader("C:\\Users\\Chudnofsky\\Desktop\\Projekt\\Neu\\Messwerte.txt"))
              {
                  lock (this)
                  {
                      string line;
                      line = reader.ReadLine() + Environment.NewLine;
                      stream = tcpClient.GetStream();
                      byte[] toSend = Encoding.ASCII.GetBytes(line);
                      stream.Write(toSend, 0, toSend.Length);
                      stream.Flush();
                  }
              }
          }
      }
      catch (Exception)
      {
          System.Windows.Forms.MessageBox.Show("Datei konnte nicht gelesen werden!");
      }
  }
  </code></pre>