1.根据下载路径下载文件方法
/// <summary>
///文件下载
/// </summary>
/// <param name="filePath">下载路径</param>
/// <param name="account">账号参数</param>
public static void SaveStockLogDownLoadInClient(string filePath, string account)
{
bool Value = false;
WebResponse response = null;
Stream stream = null;
try
{
//获取当前进程的目录
var dir = Path.Combine(Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName));
//拼接目录路径
var path = Path.Combine(dir, "StockDownLoad", account);
if (!Directory.Exists(path))
{
//路径不存在按照路径创建文件夹
Directory.CreateDirectory(path);
}
//生成对应的文件名