/// <summary> /// Используется в SetEmitents для добавления инструмента в заданный узел-секцию /// </summary> /// <param name="node">узел-секция куда будет добавлен инструмент</param> /// <param name="emitent">инструмент для добавления</param> private void AddEmitent(TreeNode node, EmitentInfo emitent) { TreeNode i = node.Nodes.Add(emitent.Name); i.Tag = emitent; if (emitent.Checked) { i.ImageIndex = 1; i.SelectedImageIndex = 1; } }
public static string Download(Settings settings, EmitentInfo emitent, DateTime date) { string link = String.Format("http://195.128.78.52/{0}.{1}?d=d&market={2}&em={3}&p={4}&df={5}&mf={6}&yf={7}&dt={8}&mt={9}&yt={10}&f={11}&e=.{12}&datf={13}&cn={14}&dtf=1&tmf=1&MSOR=0&sep=3&sep2=1&at=1", emitent.Code, "csv", emitent.MarketId, emitent.Id, 1,//settings.period, date.Day, date.Month - 1, date.Year, date.Day, date.Month - 1, date.Year, emitent.Code, "csv", 11,//format, if (settings.period == 1) format = 11; else format = 5; emitent.Code ); l.Debug("Скачиваю " + link); System.Net.WebClient webClient = InitWebClient(settings); webClient.Headers.Add("Referer", @"http://www.finam.ru/analysis/export/default.asp"); string result = string.Empty; try { result = webClient.DownloadString(link); } catch (Exception e) { result = "Exception"; l.Info("Ошибка при скачивании " + e); } return(result); }
public static string Download(Settings settings, EmitentInfo emitent, DateTime date) { string link = String.Format("http://195.128.78.52/{0}.{1}?d=d&market={2}&em={3}&p={4}&df={5}&mf={6}&yf={7}&dt={8}&mt={9}&yt={10}&f={11}&e=.{12}&datf={13}&cn={14}&dtf=1&tmf=1&MSOR=0&sep=3&sep2=1&at=1", emitent.Code, "csv", emitent.MarketId, emitent.Id, 1,//settings.period, date.Day, date.Month - 1, date.Year, date.Day, date.Month - 1, date.Year, emitent.Code, "csv", 11,//format, if (settings.period == 1) format = 11; else format = 5; emitent.Code ); l.Debug("Скачиваю " + link); System.Net.WebClient webClient = InitWebClient(settings); webClient.Headers.Add("Referer", @"http://www.finam.ru/analysis/export/default.asp"); string result = string.Empty; try { result = webClient.DownloadString(link); } catch (Exception e) { result = "Exception"; l.Info("Ошибка при скачивании " + e); } return result; }