2020年6月17日 星期三

NTPC OpenData API

api 列表

使用方式 (以政府行政機關辦公日曆表為例)
====
string url = "https://data.ntpc.gov.tw/api/datasets/308DCD75-6434-45BC-A95F-584DA4FED251/json?page=0&size=10000";
var request = WebRequest.Create(url);
request.Method = "GET";
request.ContentType = "application/json;charset=UTF-8";
var response = request.GetResponse() as HttpWebResponse;
var responseStream = response.GetResponseStream();
var reader = new StreamReader(responseStream, System.Text.Encoding.GetEncoding("utf-8"));
var jsonlist = reader.ReadToEnd();
var list = JsonConvert.DeserializeObject>(jsonlist);
var 今年資料s = list.Where(a => a.Value("date").Year == DateTime.Now.Year).ToList();

沒有留言:

input 連結 datalist 用程式控制彈出選項

範例: nextTick(() => document.querySelector('input').showPicker());  ※僅支援現代瀏覽器