Postovani, treba mi pomoc. Treba da napravim program koji skida podatke sa sajta i razvrstava ih u excel tabelu. Nasao sam neki slican program, ali mi nije jasan deo koda sta se odvija u tom programu. Ima li neko vremena da mi to rastumaci
Taj kod glasi
lbl_status.Invoke(new MethodInvoker(delegate
{
lbl_info.Text = "Processing symbol ->" + currentSymbol + " (" + (currentSymbolIndex + 1) + "/" + symbolList.Count + ") : IS";
lbl_status.Text = "Status : Processing to fetch Income Statement data for Ticker - ( " + currentSymbol + " ).Ticker position is " + (currentSymbolIndex + 1) + " out of " + symbolList.Count + " total tickers.";
}));
string INCOME_STATEMENT_RESULT = GetAPIData.GetIncomeStatementData(currentSymbol);
if (!INCOME_STATEMENT_RESULT.Equals(""))
{
dynamic isData = Newtonsoft.Json.JsonConvert.DeserializeObject(INCOME_STATEMENT_RESULT);
isTitleList = new List<string>();
yearList = isData["Years"].ToObject<List<string>>();
isTitleList = isData["Title"].ToObject<List<string>>();
lbl_status.Invoke(new MethodInvoker(delegate
{
lbl_status.Text = "Status : Saving Income Statement data for Ticker - (" + currentSymbol + ").";
}));
//Generating keys for Income Statement Data
for (int i = 0; i < isTitleList.Count; i++)
{
string title = isTitleList;
for (int j = 0; j < yearList.Count; j++)
{
string year = yearList[j];
if (!overAllYears.Contains(year))
{
overAllYears.Add(year);
}
List<string> yearData = isData["Values"][year].ToObject<List<string>>();
string key = title + "_" + year;
if (!TempiskeyList.Contains(title))
{
TempiskeyList.Add(title);
}
tempData.Add(key, yearData);
}
}
}
Taj kod glasi
lbl_status.Invoke(new MethodInvoker(delegate
{
lbl_info.Text = "Processing symbol ->" + currentSymbol + " (" + (currentSymbolIndex + 1) + "/" + symbolList.Count + ") : IS";
lbl_status.Text = "Status : Processing to fetch Income Statement data for Ticker - ( " + currentSymbol + " ).Ticker position is " + (currentSymbolIndex + 1) + " out of " + symbolList.Count + " total tickers.";
}));
string INCOME_STATEMENT_RESULT = GetAPIData.GetIncomeStatementData(currentSymbol);
if (!INCOME_STATEMENT_RESULT.Equals(""))
{
dynamic isData = Newtonsoft.Json.JsonConvert.DeserializeObject(INCOME_STATEMENT_RESULT);
isTitleList = new List<string>();
yearList = isData["Years"].ToObject<List<string>>();
isTitleList = isData["Title"].ToObject<List<string>>();
lbl_status.Invoke(new MethodInvoker(delegate
{
lbl_status.Text = "Status : Saving Income Statement data for Ticker - (" + currentSymbol + ").";
}));
//Generating keys for Income Statement Data
for (int i = 0; i < isTitleList.Count; i++)
{
string title = isTitleList;
for (int j = 0; j < yearList.Count; j++)
{
string year = yearList[j];
if (!overAllYears.Contains(year))
{
overAllYears.Add(year);
}
List<string> yearData = isData["Values"][year].ToObject<List<string>>();
string key = title + "_" + year;
if (!TempiskeyList.Contains(title))
{
TempiskeyList.Add(title);
}
tempData.Add(key, yearData);
}
}
}