using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Security.Cryptography; using System.Text; using System.Windows.Forms; using tpDomeWinAPP.Service; using tpDomeWinAPP.Models; using System.Linq; using System.Collections; using NPOI.SS.Formula.Functions; namespace z01_WinAPP { public partial class fmKeke : Form { List ds; public fmKeke() { InitializeComponent(); } private void fmKeke_Load(object sender, EventArgs e) { } private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e) { } private void button1_Click(object sender, EventArgs e) { loadData_fic(); } private void loadData_fic() { lbMsg.Text = "Loading ..."; // https://green.fic.com.tw:8443/obix/config/ // ObixUser // Admin123456 webRequestSvc svc = new webRequestSvc(); //local:|foxs:|history:/S02102000101/Inv|view:history:HistoryTable string url_slot = "history:/S02102000101/Inv|"; string bql = url_slot + "bql:select *"; string obix_url = "https://green.fic.com.tw:8443/obix/histories/S03203000101/Inv/~historyQuery/"; string post_xml = ""; ds = svc.obixQuery_keke(obix_url, post_xml); //ds = svc.obixQuery("http://60.251.164.125:8080/obix/config/Arena/Program/ObixQuery/query/", bql); //ds = svc.obixQuery("http://60.251.164.125:8080/obix/config/Program/ObixQuery/query/", bql);//三菱 //ds = svc.obixQuery("http://192.168.0.136:8081/obix/config/Program/ObixQuery/query/", bql);//wsp //ds = svc.obixQuery("http://localhost:8080/obix/config/Program/ObixQuery/query/", bql); //dataGridView1.DataSource = ds; dataGridView1.Columns[0].Visible = false; dataGridView1.Columns[1].Width = 400; dataGridView1.Columns[2].Width = 200; //lbMsg.Text = "共 " + ds.Count.ToString() + " 筆資料 " + Environment.NewLine + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } private void button1_Click_1(object sender, EventArgs e) { string targetTable = "archive_electric_meter_day_202308"; string yyyymm = targetTable.Split('_')[targetTable.Split('_').Length - 1]; //取出 archive_electric_meter_day_202308 的最後一段 202308 string yyyy = yyyymm.Substring(0, 4); string mm = yyyymm.Remove(0, 4); } } }