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;
                    }
posted on 2013-08-14 11:30  swarb  阅读(937)  评论(0编辑  收藏  举报