HTTP
Thu Oct 30 2025 02:58:53 GMT+0000 (Coordinated Universal Time)
Saved by
@vplab
string url = textBox1.Text.Trim();
if (string.IsNullOrEmpty(url))
{
MessageBox.Show("Please enter a URL.");
return;
}
// Save to Documents folder
string localPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\downloaded_file.txt";
try
{
using (WebClient client = new WebClient())
{
client.DownloadFile(url, localPath);
}
MessageBox.Show($" File downloaded successfully to:\n{localPath}");
}
catch (Exception ex)
{
MessageBox.Show(" Error: " + ex.Message);
}
content_copyCOPY
Comments