zoukankan      html  css  js  c++  java
  • C# 下载远程http文件到本地

     System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog();
                    dialog.Description = "请选择保存路径";
                    if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        string url = q.IpAddress + path;
                        try
                        {
                            using (var client = new System.Net.WebClient())
                            {
                                client.DownloadFile(url, dialog.SelectedPath + "\" + System.IO.Path.GetFileName(path));
                            }
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message, "下载异常");
                            return;
                        }
  • 相关阅读:
    JS 对象定义
    JavaScript HTML DOM 元素(节点)
    DOM 事件
    DOM CSS
    DOM HTML
    DOM 简介
    JS 验证
    JS 错误
    JavaScript Break 和 Continue 语句
    JS While
  • 原文地址:https://www.cnblogs.com/swarb/p/9924300.html
Copyright © 2011-2022 走看看