使用ASP .NET (C#) 產生PDF檔的好幫手—iTextSharp library (上)
https://www.cc.ntu.edu.tw/chinese/epaper/0015/20101220_1509.htm
https://www.cc.ntu.edu.tw/chinese/epaper/0015/20101220_1509.htm
目的: 如何在 Web程式,如何執行[標籤]的印表機列印
目的: 說明字串2Object 函式 , JSON.Parse 和 Ext.decode的差異
說明:
1>若為標準的JSON字串(含字串引號) , 則JSON.Parse 及 Ext.decode均可正常解碼成 Object
Ex: var Tmp_ObjAryStr = "{ "Key": "ABC" }"; //實際字串: "{ \"Key\": \"ABC\" }"
2>若為非標準的JSON字串(不含字串引號) ,
則Ext.decode可正常解碼成 Object
但JSON.Parse無法正常解碼成 Object
Ex: var Tmp_ObjAryStr2 = "{Key: 'ABC' }";
目的: 1>說明主機端傳回 string vs Http.StringContent vs HttpResponseMessage 的不同(主機端)
2>說明主機端傳回 string vs Http.StringContent vs HttpResponseMessage , 在前端接收的結果
摘要:
1> *.cs c# 主機端 *Controller:
1>>String Tmp_RtnStr; //一般的字串
var store1 = Ext.create('Ext.data.Store', {
id: 'store1',
pageSize: 10,
fields: par_Fields,
autoLoad: true,
proxy: {
type: 'ajax',
url: '../api/myAPI/SQLOPEN',
extraParams: np,
getMethod: function () { return 'POST'; },
async: false,
reader: { // reader: The Ext.data.reader.Reader to use to decode the server's response or data read from client.
type: 'json', //The JSON Reader is used by a Proxy to read a server response that is sent back in JSON format
root: 'T1', //The name of the property which contains the data items corresponding to the Model(s) for which this Reader is configured. For JSON reader it's a property name (or a dot-separated list of property names if the root is nested).
totalProperty: 'T1C[0].TOTAL' //Name of the property from which to retrieve the total number of records in the dataset.
//T1C必需有 TOTAL 欄位
}
}
}
})
JSON 的完整語法如下:
JSON = null
or true or false or JSONNumber or JSONString or JSONObject or JSONArray JSONNumber = - PositiveNumber or PositiveNumber PositiveNumber = DecimalNumber or DecimalNumber . Digits or DecimalNumber . Digits ExponentPart or DecimalNumber ExponentPart DecimalNumber = 0 or OneToNine Digits ExponentPart = e Exponent or E Exponent Exponent = Digits or + Digits or - Digits Digits = Digit or Digits Digit Digit = 0 through 9 OneToNine = 1 through 9 JSONString = "" or " StringCharacters " StringCharacters = StringCharacter or StringCharacters StringCharacter StringCharacter = any character except " or \ or U+0000 through U+001F or EscapeSequence EscapeSequence = \" or \/ or \\ or \b or \f or \n or \r or \t or \u HexDigit HexDigit HexDigit HexDigit HexDigit = 0 through 9 or A through F or a through f JSONObject = { } or { Members } Members = JSONString : JSON or Members , JSONString : JSON JSONArray = [ ] or [ ArrayElements ] ArrayElements = JSON or ArrayElements , JSON二.JSON函式用法