宣告:System.Collections.ArrayList Msg = new System.Collections.ArrayList();
使用:Msg.Insert(0,"M0"); //新增
1: public string PageSql(string Condition, int CurrentPage, int PageSize, string SortSql, string TableName, string SelectField)
2: {3: string sql = string.Empty;
4: int PageStart = PageSize * (CurrentPage - 1) + 1;
5: int PageEnd = PageStart + PageSize - 1;
6: if (CurrentPage <= 1)
7: {8: string Top = PageSize > 0 ? " top " + PageSize : "";
9: sql = string.Format("Select " + Top + " {0} From {1} {2} {3}", SelectField, TableName, Condition, SortSql);
10: }11: else
12: {13: sql = "select {0} from(select {1}, ROW_NUMBER() OVER ( {2} ) as Pos from {3} {4}) as RowID where RowID.Pos between " + PageStart + " and " + PageEnd;
14: sql = string.Format(sql, Regex.Replace(SelectField, "([a-zA-Z0-9_]+\\.)", ""), SelectField, SortSql, TableName, Condition);
15: }16: return sql;
17: }1: private List<string> GetImagesInHTMLString(string htmlString)
2: {3: List<string> images = new List<string>();
4: string pattern = @"<(img)\b[^>]*>";
5: 6: Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
7: MatchCollection matches = rgx.Matches(htmlString); 8: 9: for (int i = 0, l = matches.Count; i < l; i++)
10: { 11: images.Add(matches[i].Value); 12: } 13: 14: return images;
15: }
1: if(event.which || event.keyCode)
2: {3: if ((event.which == 13) || (event.keyCode == 13))
4: {5: __doPostBack('Search1$LinkButton1','');
6: //參照render後的Html原始碼得知要參考的事件控制項觸發事件,加入到Textbox keydown事件中
7: return false;
8: } 9: }10: else
11: {12: return true
13: }; 14: 15: 16: 17: utton1','');return false;}} else {return true}; ");
1: public class GenericClass<T,U>
2: {3: public T t;
4: public U u;
5: 6: public GenericClass(T _t, U _u)
7: { 8: t = _t; 9: u = _u; 10: } 11: }
1: public class Employee
2: {3: public string name;
4: protected decimal basepay;
5: 6: public Employee(string name, decimal basepay)
7: {8: this.name = name;
9: this.basepay = basepay;
10: } 11: 12: public virtual decimal CalculatePay()
13: //virtual這字眼是說自己的這個東西(方法、屬性等等的)被誰繼承去之後,可以給改寫或蹂躪的
14: {15: return basepay;
16: } 17: }
1: <script> 2: 3: $(document).ready(function () { 4: var json = JSON.stringify({5: UUID: "F1AC71F4-B9A8-4BFD-941F-68E21689D263",
6: Name: "UserName",
7: Password: "password",
8: Event: "Evt0001"
9: }); 10: $.ajax({11: url: "http://localhost:1856/api/TestApI",
12: cache: false,
13: type: 'POST',
14: contentType: 'application/json; charset=utf-8',
15: data: json, 16: statusCode: {17: 201 /*Created*/: function (data) {
18: 19: } 20: } 21: }); 22: }); 23: </script>1: public Dictionary<string, string> Post(Dictionary<string, object> value)
2: { 3: 4: return new Dictionary<string, string>()
5: {6: {"UUID", value["UUID"].ToString()},
7: {"Name", value["Name"].ToString()},
8: {"Event", value["Event"].ToString()},
9: {"Code", "0"},
10: {"Msg", ""},
11: {"Link", "http://AD.TEST.com"}
12: }; 13: }