發表文章

windows 10 記憶體無法釋放解決方法

買了新電腦後安裝Win 10 一開始得很順 但每次下載東西或長時間沒有重新開機記憶體都會衝到99% 之後當然就超Lag,Lag到只能強制重開機。 經過不斷的測試發現到的問題: 記憶體部會釋放     ● 正常關機後再打開也會發現記憶體是一樣的%數(EX:關機前50%,開機後直接50%)     ● 從win8升級到win 10 一樣無解     ● 直接重灌win 10 依然無解 ※ 前前後後應該有重灌3次以上吧orz... 最後解決方法是以下影片:  (Still works November 2016) Memoryleak Fix WINDOWS 10 (And 8/8.1) | 1080P HD 60FPS https://www.youtube.com/watch?v=7_yv-sZxub4 如果有人遇到類似的問題可以試試看

Making HTTP POST Requests in JavaScript

透過Javascript實做Http 呼叫Api var http = new XMLHttpRequest(); var url = "http://localhost:25959/api/login"; var params = "acc=123123&pw=0958113359"; http.open("POST", url, true); //Send the proper header information along with the request http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 && http.status == 200) { console.log(http.responseText); } } http.send(params); readyState定義 Value State Description 0 UNSENT The open method hasn't been called yet 1 OPENED The send method has been called 2 HEADERS_RECEIVED The send method has been called and the HTTP request has returned the status and headers 3 LOADING The HTTP request response is being downloaded 4 DONE Everything has completed 文章: https://www.kirupa.com/html5/making_http_requests_js.htm

Making HTTP GET Requests in JavaScript

透過Javascript實做Http 呼叫Api var xhr = new XMLHttpRequest(); xhr.open('GET', "http://localhost:25959/api/login?Acc=123123&Pw=AA", true); xhr.send(); xhr.onreadystatechange = processRequest; function processRequest(e) { if (xhr.readyState == 4 && xhr.status == 200) { var response = JSON.parse(xhr.responseText); console.log(response.Acc); } } readyState定義 Value State Description 0 UNSENT The open method hasn't been called yet 1 OPENED The send method has been called 2 HEADERS_RECEIVED The send method has been called and the HTTP request has returned the status and headers 3 LOADING The HTTP request response is being downloaded 4 DONE Everything has completed 文章: https://www.kirupa.com/html5/making_http_requests_js.htm

javascript window close event confirm

當瀏覽器關閉的時會先呼叫,不會直接關閉。 window.onbeforeunload = function (e) {     e = e || window.event;     // For IE and Firefox prior to version 4     if (e) {         e.returnValue = 'Any string';     }     // For Safari     return 'Any string'; };  Here is a working  jsFiddle

Put 參數傳送方法

I was trying to do this the easy way with C#, but apparently that is not the tool of choice from looking at the code samples :) private bool PutData(string sURL, string sData, out string sResponse) { try { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] arr = encoding.GetBytes(sData); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sURL); request.Credentials = new NetworkCredential(" ", " "); request.Method = "PUT"; request.ContentType = "text/xml"; request.ContentLength = arr.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(arr, 0, arr.Length); dataStream.Close(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream respStream =

C#, WebRequest PUT, and XML

I was trying to do this the easy way with C#, but apparently that is not the tool of choice from looking at the code samples :) private bool PutData(string sURL, string sData, out string sResponse) { try { System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] arr = encoding.GetBytes(sData); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sURL); request.Credentials = new NetworkCredential(" ", " "); request.Method = "PUT"; request.ContentType = "text/xml"; request.ContentLength = arr.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(arr, 0, arr.Length); dataStream.Close(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream respStream =