You have two issues here. First you're overwriting your file for each and every link you found in the HTML and secondly you built an infinite loop writing to that file. Here is your code with the fixes:
WebClient client = new WebClient();
string html = client.DownloadString(textBox1.Text);
HtmlTag tag;
HtmlParser.HtmlParser parse = new HtmlParser.HtmlParser(html);
fs = new FileStream("URL.txt", FileMode.Create, FileAccess.Write);
sw = new StreamWriter(fs);
while (parse.ParseNext("a", out tag))
{
string value;
if (tag.Attributes.TryGetValue("href", out value))
{
sw.WriteLine(value);
}
}
sw.Close();
MessageBox.Show("Done!");
Regards,
Manfred