how to download plain text files c sharp?

Jason

New member
i am trying to build a app that will download torrent files, and while it downloads. it seems not to save it correctly, it seems to have a missing header or something if you open the file you don't see the tracker info , the file is about 3kb smaller than the original.

private void submitButton_Click(object sender, EventArgs e)
{
string hashCodeString;
hashCodeString = hashTextBox.Text;
addressTextBox.Text = "http://www.torrage.com/torrent/" + hashCodeString +".torrent";
torrageLinkLabel.Text = addressTextBox.Text;
}

private void torrageLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
using (var client = new WebClient())
{
client.DownloadFile(torrageLinkLabel.Text, @"C:\torrent\file.torrent");
}

FileStream FileStream = new FileStream(@"c:\torrent\file.torrent", FileMode.Open);
try
{
//read file
}

finally
{
FileStream.Close();
}
}
not sure why its missing the header / trackers
 
Back
Top