您好,我無法乘上從google finance api檢索到的數據。我知道我現在正在做的事情是錯誤的,所以我想就如何去做這件事以及一些例子進行說明。在對xml中的數據執行乘法操作時遇到問題
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");
}
ERROR
請告訴我們錯誤,當你做乘法 – HatSoft 2012-07-19 10:47:47
燁,我補充說謝謝你提醒我! – Challenger 2012-07-19 10:53:11