こんにちは、Google Finance API から取得したデータの乗算に問題があります。私が今していることは間違っていることを知っているので、それを行う方法とその例についてのいくつかの指針が欲しい.
string url = "http://www.google.com/ig/api?stock=" + Server.UrlEncode(symbol1.Text);
XmlDocument xdoc = new XmlDocument();
xdoc.Load(url);
currentPrice1.Text = GetData(xdoc, "last");
int quantity = 50;
int currentPrice = int.Parse(currentPrice1.Text);
int totalValue = quantity * currentPrice;
GetData メソッド
private string GetData(XmlDocument doc2, string strElement)
{
XmlNodeList xnodelist5 = doc2.GetElementsByTagName(strElement);
XmlNode xnode5 = xnodelist5.Item(0);
return Get_Attribute_Value(xnode5, "data");
}
エラー