/// <summary> /// 下一個 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (iStock < (Stocks.Count() - 1)) { iStock = iStock + 1; } GoToWeb(); }
static void Main(string[] args) { Stocks <int> elementos = new Stocks <int> (4); elementos.Push(1); elementos.Push(4); elementos.Push(10); elementos.Push(15); Console.WriteLine("Elementos de la pila"); Console.WriteLine(elementos.Pop()); Console.WriteLine(elementos.Pop()); Console.WriteLine(elementos.Pop()); Console.WriteLine(elementos.Pop()); //Cola string Nombre; Queue Cola = new Queue(); Cola.Enqueue("Carlos \n"); Cola.Enqueue("Raul \n"); Cola.Enqueue("Daniel \n"); Cola.Enqueue("Fer"); Console.WriteLine("/////////////////"); Console.WriteLine("Elementos de la Cola"); for (int i = 0; i < 4; i++) { Nombre = (string)Cola.Dequeue(); Console.Write(Nombre); } }
private void GoToWeb() { webBrowser1.Url = new Uri(string.Format(@"https://so.cnyes.com/JavascriptGraphic/chartstudy.aspx?country=tw&market=tw&code={0}&divwidth=990&divheight=330", Stock.Id.ToString())); label1.Text = string.Format("{0} {1} {2}/{3}", Stock.Id, Stock.Name, iStock, Stocks.Count() - 1); label2.Text = GetStockType(); }
private void GoTo() { try { string today = System.DateTime.Today.ToString("yyyy-MM-dd"); string yearAgo = System.DateTime.Today.AddYears(-1).ToString("yyyy-MM-dd"); string rnd = System.Guid.NewGuid().ToString().Replace("-", ""); string filename = "i" + rnd + "__Rimage"; string filenamePNG = filename + ".png"; string rcode = string.Format(@"library(quantmod) stock <- getSymbols('{0}.TW', auto.assign = FALSE,from='{1}') ind <- apply(stock, 1, function(x) all(is.na(x))) stock <- stock[!ind,] chartSeries(stock['{1}::{2}'],name='{3}')" , Stock.Id, "2017-01-03", "2018-01-25", filename); REngine engine = REngine.GetInstance(); engine.Initialize(); //engine.Evaluate(string.Format("png(file='{0}',bg ='transparent',width={1},height={2})", filename, this.pictureBox1.Width, this.pictureBox1.Height)); engine.Evaluate(rcode); //engine.Evaluate("dev.off"); //string path = System.IO.Path.GetFullPath(filenamePNG); //Bitmap image = new Bitmap(path); //pictureBox1.Image = image; label1.Text = string.Format("{0} {1} {2}/{3}", Stock.Id, Stock.Name, iStock, Stocks.Count()); label2.Text = GetStockType(); } catch (Exception e) { } }