.net Json JavaScriptSerializer JsonHelper类

结合.net 的JavaScriptSerializer 类实现Json数据处理

调用1:

     Model.Users m = BLL.UsersBLL.GetUserById(Convert.ToInt32(id));string result = "";if (m != null)result = JsonHelper.ObjectToJSON(m);context.Response.Write(result);    

 调用2:

    Hashtable ht = new Hashtable();List<Model.UsersModel> resultlist = BLL.UsersBLL.GetUsersList(type, begin, end, page, 4, ht);string result = JsonHelper.ObjectToJSON(new{@list = resultlist,@today = DateTime.Now.ToString("yyyy-MM-dd"),@pageIndex = page,@recordCount = ht["rowcount"],@pageCount = ht["pagecount"]});context.Response.Write(result);
//
前台JS调用Json数据

$.ajax({
url: "../handler/zeji.ashx",
type: "POST",
data: "type=" + type + "&time=" + time + "&page=" + page,
//completed: $("#indicator").hide(),
success: function (data) {
data = eval("(" + data + ")");

   for (var i = 0; i < data.list.length; i++) {

    var riqi = data.list[i].Riqi.toString();

 }

var recordCount = data.recordCount;

}

});

 

 

JsonHelper 类

public class JsonHelper
{#region 私有方法/// <summary>/// 过滤特殊字符/// </summary>private static string StringToJson(String s){StringBuilder sb = new StringBuilder();for (int i = 0; i < s.Length; i++){char c = s.ToCharArray()[i];switch (c){case '\"':sb.Append("\\\""); break;case '\\':sb.Append("\\\\"); break;case '/':sb.Append("\\/"); break;case '\b':sb.Append("\\b"); break;case '\f':sb.Append("\\f"); break;case '\n':sb.Append("\\n"); break;case '\r':sb.Append("\\r"); break;case '\t':sb.Append("\\t"); break;default:sb.Append(c); break;}}return sb.ToString();}/// <summary>/// 格式化字符型、日期型、布尔型/// </summary>private static string StringFormat(string str, Type type){if (type == typeof(string)){str = StringToJson(str);str = "\"" + str + "\"";}else if (type == typeof(DateTime)){str = "\"" + str + "\"";}else if (type == typeof(bool)){str = str.ToLower();}else if (type != typeof(string) && string.IsNullOrEmpty(str)){str = "\"" + str + "\"";}return str;}#endregion#region List转换成Json/// <summary>/// List转换成Json/// </summary>public static string ListToJson<T>(IList<T> list){object obj = list[0];return ListToJson<T>(list, obj.GetType().Name);}/// <summary>/// List转换成Json /// </summary>public static string ListToJson<T>(IList<T> list, string jsonName){StringBuilder Json = new StringBuilder();if (string.IsNullOrEmpty(jsonName)) jsonName = list[0].GetType().Name;Json.Append("{\"" + jsonName + "\":[");if (list.Count > 0){for (int i = 0; i < list.Count; i++){T obj = Activator.CreateInstance<T>();PropertyInfo[] pi = obj.GetType().GetProperties();Json.Append("{");for (int j = 0; j < pi.Length; j++){Type type = pi[j].GetValue(list[i], null).GetType();Json.Append("\"" + pi[j].Name.ToString() + "\":" + StringFormat(pi[j].GetValue(list[i], null).ToString(), type));if (j < pi.Length - 1){Json.Append(",");}}Json.Append("}");if (i < list.Count - 1){Json.Append(",");}}}Json.Append("]}");return Json.ToString();}#endregion#region 对象转换为Json/// <summary> /// 对象转换为Json /// </summary> /// <param name="jsonObject">对象</param> /// <returns>Json字符串</returns> public static string ToJson(object jsonObject){string jsonString = "{";PropertyInfo[] propertyInfo = jsonObject.GetType().GetProperties();for (int i = 0; i < propertyInfo.Length; i++){object objectValue = propertyInfo[i].GetGetMethod().Invoke(jsonObject, null);string value = string.Empty;if (objectValue is DateTime || objectValue is Guid || objectValue is TimeSpan){value = "'" + objectValue.ToString() + "'";}else if (objectValue is string){value = "'" + ToJson(objectValue.ToString()) + "'";}else if (objectValue is IEnumerable){value = ToJson((IEnumerable)objectValue);}else{value = ToJson(objectValue.ToString());}jsonString += "\"" + ToJson(propertyInfo[i].Name) + "\":" + value + ",";}jsonString.Remove(jsonString.Length - 1, jsonString.Length);return jsonString + "}";}#endregion#region 对象集合转换Json/// <summary> /// 对象集合转换Json /// </summary> /// <param name="array">集合对象</param> /// <returns>Json字符串</returns> public static string ToJson(IEnumerable array){string jsonString = "[";foreach (object item in array){jsonString += ToJson(item) + ",";}jsonString.Remove(jsonString.Length - 1, jsonString.Length);return jsonString + "]";}#endregion#region 普通集合转换Json/// <summary> /// 普通集合转换Json /// </summary> /// <param name="array">集合对象</param> /// <returns>Json字符串</returns> public static string ToArrayString(IEnumerable array){string jsonString = "[";foreach (object item in array){jsonString = ToJson(item.ToString()) + ",";}jsonString.Remove(jsonString.Length - 1, jsonString.Length);return jsonString + "]";}#endregion#region Object转JSON/// <summary>/// 对象转JSON/// </summary>/// <param name="obj">对象</param>/// <returns>JSON格式的字符串</returns>public static string ObjectToJSON(object obj){JavaScriptSerializer jss = new JavaScriptSerializer();try{return jss.Serialize(obj);}catch (Exception ex){throw new Exception("JSONHelper.ObjectToJSON(): " + ex.Message);}}#endregion#region  DataSet转换为Json/// <summary> /// DataSet转换为Json /// </summary> /// <param name="dataSet">DataSet对象</param> /// <returns>Json字符串</returns> public static string ToJson(DataSet dataSet){string jsonString = "{";foreach (DataTable table in dataSet.Tables){jsonString += "\"" + table.TableName + "\":" + ToJson(table) + ",";}jsonString = jsonString.TrimEnd(',');return jsonString + "}";}#endregion#region DataSet转键值对数组字典/// <summary>/// 数据集转键值对数组字典/// </summary>/// <param name="dataSet">数据集</param>/// <returns>键值对数组字典</returns>public static Dictionary<string, List<Dictionary<string, object>>> DataSetToDic(DataSet ds){Dictionary<string, List<Dictionary<string, object>>> result = new Dictionary<string, List<Dictionary<string, object>>>();foreach (DataTable dt in ds.Tables)result.Add(dt.TableName, DataTableToList(dt));return result;}#endregion#region Datatable转换为Json/// <summary> /// Datatable转换为Json /// </summary> /// <param name="table">Datatable对象</param> /// <returns>Json字符串</returns> public static string ToJson(DataTable dt){StringBuilder jsonString = new StringBuilder();jsonString.Append("[");DataRowCollection drc = dt.Rows;for (int i = 0; i < drc.Count; i++){jsonString.Append("{");for (int j = 0; j < dt.Columns.Count; j++){string strKey = dt.Columns[j].ColumnName;string strValue = drc[i][j].ToString();Type type = dt.Columns[j].DataType;jsonString.Append("\"" + strKey + "\":");strValue = StringFormat(strValue, type);if (j < dt.Columns.Count - 1){jsonString.Append(strValue + ",");}else{jsonString.Append(strValue);}}jsonString.Append("},");}jsonString.Remove(jsonString.Length - 1, 1);jsonString.Append("]");return jsonString.ToString();}/// <summary>/// DataTable转换为Json /// </summary>public static string ToJson(DataTable dt, string jsonName){StringBuilder Json = new StringBuilder();if (string.IsNullOrEmpty(jsonName)) jsonName = dt.TableName;Json.Append("{\"" + jsonName + "\":[");if (dt.Rows.Count > 0){for (int i = 0; i < dt.Rows.Count; i++){Json.Append("{");for (int j = 0; j < dt.Columns.Count; j++){Type type = dt.Rows[i][j].GetType();Json.Append("\"" + dt.Columns[j].ColumnName.ToString() + "\":" + StringFormat(dt.Rows[i][j].ToString(), type));if (j < dt.Columns.Count - 1){Json.Append(",");}}Json.Append("}");if (i < dt.Rows.Count - 1){Json.Append(",");}}}Json.Append("]}");return Json.ToString();}#endregion#region DataTable转键值对集合/// <summary>/// 数据表转键值对集合/// 把DataTable转成 List集合, 存每一行/// 集合中放的是键值对字典,存每一列/// </summary>/// <param name="dt">数据表</param>/// <returns>哈希表数组</returns>public static List<Dictionary<string, object>> DataTableToList(DataTable dt){List<Dictionary<string, object>> list= new List<Dictionary<string, object>>();foreach (DataRow dr in dt.Rows){Dictionary<string, object> dic = new Dictionary<string, object>();foreach (DataColumn dc in dt.Columns){dic.Add(dc.ColumnName, dr[dc.ColumnName]);}list.Add(dic);}return list;}#endregion#region DataTable转List<T>/// <summary>/// DataTable转List<T>/// </summary>/// <typeparam name="T">数据项类型</typeparam>/// <param name="dt">DataTable</param>/// <returns>List数据集</returns>public static List<T> DataTableToList<T>(DataTable dt) where T : new(){List<T> tList = new List<T>();if (dt == null || dt.Rows.Count == 0){return tList;}PropertyInfo[] propertys = typeof(T).GetProperties();   //获取此实体的公共属性foreach (DataRow dr in dt.Rows){T t = new T();foreach (PropertyInfo pi in propertys){if (!pi.CanWrite){continue;}string columnName = pi.Name;if (dr.Table.Columns.Contains(columnName)){// 判断此属性是否有Setter或columnName值是否为空object value = dr[columnName];if (value is DBNull || value == DBNull.Value || value == null || !pi.CanWrite){continue;}#region SetValuetry{switch (pi.PropertyType.ToString()){case "System.String":pi.SetValue(t, Convert.ToString(value), null);break;case "System.ToChar":pi.SetValue(t, Convert.ToChar(value), null);break;case "System.Int64":pi.SetValue(t, Convert.ToInt64(value), null);break;case "System.Int32":pi.SetValue(t, Convert.ToInt32(value), null);break;case "System.ToUInt64":pi.SetValue(t, Convert.ToUInt64(value), null);break;case "System.ToUInt32":pi.SetValue(t, Convert.ToUInt32(value), null);break;case "System.DateTime":pi.SetValue(t, Convert.ToDateTime(value), null);break;case "System.Boolean":pi.SetValue(t, Convert.ToBoolean(value), null);break;case "System.Double":pi.SetValue(t, Convert.ToDouble(value), null);break;case "System.Decimal":pi.SetValue(t, Convert.ToDecimal(value), null);break;case "System.Single":pi.SetValue(t, Convert.ToSingle(value), null);break;default:pi.SetValue(t, value, null);break;}}catch{//throw (new Exception(ex.Message));
                    }#endregion}}tList.Add(t);}return tList;}#endregion#region DataTable转JSON/// <summary>/// 数据表转JSON/// </summary>/// <param name="dataTable">数据表</param>/// <returns>JSON字符串</returns>public static string DataTableToJSON(DataTable dt){return ObjectToJSON(DataTableToList(dt));}#endregion#region 泛型集合转DataTable/// <summary>/// 泛型集合转DataTable/// </summary>/// <typeparam name="T">集合类型</typeparam>/// <param name="entityList">泛型集合</param>/// <returns>DataTable</returns>public static DataTable ListToDataTable<T>(IList<T> entityList){if (entityList == null) return null;DataTable dt = CreateTable<T>();Type entityType = typeof(T);//PropertyInfo[] properties = entityType.GetProperties();PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType);foreach (T item in entityList){DataRow row = dt.NewRow();foreach (PropertyDescriptor property in properties){row[property.Name] = property.GetValue(item);}dt.Rows.Add(row);}return dt;}#endregion#region 创建DataTable的结构/// <summary>/// 创建表结构/// </summary>/// <typeparam name="T"></typeparam>/// <returns></returns>private static DataTable CreateTable<T>(){Type entityType = typeof(T);//PropertyInfo[] properties = entityType.GetProperties();PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType);//生成DataTable的结构DataTable dt = new DataTable();foreach (PropertyDescriptor prop in properties){dt.Columns.Add(prop.Name);}return dt;}#endregion#region DataReader转换为Json/// <summary> /// DataReader转换为Json /// </summary> /// <param name="dataReader">DataReader对象</param> /// <returns>Json字符串</returns> public static string ToJson(DbDataReader dataReader){StringBuilder jsonString = new StringBuilder();jsonString.Append("[");while (dataReader.Read()){jsonString.Append("{");for (int i = 0; i < dataReader.FieldCount; i++){Type type = dataReader.GetFieldType(i);string strKey = dataReader.GetName(i);string strValue = dataReader[i].ToString();jsonString.Append("\"" + strKey + "\":");strValue = StringFormat(strValue, type);if (i < dataReader.FieldCount - 1){jsonString.Append(strValue + ",");}else{jsonString.Append(strValue);}}jsonString.Append("},");}dataReader.Close();jsonString.Remove(jsonString.Length - 1, 1);jsonString.Append("]");return jsonString.ToString();}#endregion#region DataReader转实体/// <summary>/// DataReader转实体/// </summary>/// <typeparam name="T">数据类型</typeparam>/// <param name="dr">DataReader</param>/// <returns>实体</returns>public static T DataReaderToModel<T>(IDataReader dr) where T : new(){T t = new T();if (dr == null){dr.Close();return default(T);}using (dr){if (dr.Read()){PropertyInfo[] propertys = t.GetType().GetProperties(); //获取此实体的公共属性List<string> DBFieldNameList = new List<string>(dr.FieldCount);for (int i = 0; i < dr.FieldCount; i++){DBFieldNameList.Add(dr.GetName(i).ToLower());}foreach (PropertyInfo pi in propertys){if (!pi.CanWrite){continue;}string columnName = pi.Name;if (DBFieldNameList.Contains(columnName.ToLower())){//判断此属性是否有Setter或columnName值是否为空object value = dr[columnName];if (value is DBNull || value == DBNull.Value || value == null || !pi.CanWrite){continue;}#region SetValuetry{switch (pi.PropertyType.ToString()){case "System.String":pi.SetValue(t, Convert.ToString(value), null);break;case "System.ToChar":pi.SetValue(t, Convert.ToChar(value), null);break;case "System.Int64":pi.SetValue(t, Convert.ToInt64(value), null);break;case "System.Int32":pi.SetValue(t, Convert.ToInt32(value), null);break;case "System.ToUInt64":pi.SetValue(t, Convert.ToUInt64(value), null);break;case "System.ToUInt32":pi.SetValue(t, Convert.ToUInt32(value), null);break;case "System.DateTime":pi.SetValue(t, Convert.ToDateTime(value), null);break;case "System.Boolean":pi.SetValue(t, Convert.ToBoolean(value), null);break;case "System.Double":pi.SetValue(t, Convert.ToDouble(value), null);break;case "System.Decimal":pi.SetValue(t, Convert.ToDecimal(value), null);break;case "System.Single":pi.SetValue(t, Convert.ToSingle(value), null);break;default:pi.SetValue(t, value, null);break;}}catch{//throw (new Exception(ex.Message));
                        }#endregion}}}}dr.Close();return t;}#endregion#region DataReader转List<T>/// <summary>/// DataReader转List<T>/// </summary>/// <typeparam name="T">数据类型</typeparam>/// <param name="dr">DataReader</param>/// <returns>List数据集</returns>public static List<T> DataReaderToList<T>(IDataReader dr) where T : new(){List<T> tList = new List<T>();if (dr == null){dr.Close();return tList;}using (dr){PropertyInfo[] propertys = typeof(T).GetProperties();    //获取此实体的公共属性List<string> DBFieldNameList = new List<string>(dr.FieldCount);for (int i = 0; i < dr.FieldCount; i++){DBFieldNameList.Add(dr.GetName(i).ToLower());}while (dr.Read()){T t = new T();foreach (PropertyInfo pi in propertys){if (!pi.CanWrite){continue;}string columnName = pi.Name;if (DBFieldNameList.Contains(columnName.ToLower())){// 判断此属性是否有Setter或columnName值是否为空object value = dr[columnName];if (value is DBNull || value == DBNull.Value || value == null || !pi.CanWrite){continue;}#region SetValuetry{switch (pi.PropertyType.ToString()){case "System.String":pi.SetValue(t, Convert.ToString(value), null);break;case "System.ToChar":pi.SetValue(t, Convert.ToChar(value), null);break;case "System.Int64":pi.SetValue(t, Convert.ToInt64(value), null);break;case "System.Int32":pi.SetValue(t, Convert.ToInt32(value), null);break;case "System.ToUInt64":pi.SetValue(t, Convert.ToUInt64(value), null);break;case "System.ToUInt32":pi.SetValue(t, Convert.ToUInt32(value), null);break;case "System.DateTime":pi.SetValue(t, Convert.ToDateTime(value), null);break;case "System.Boolean":pi.SetValue(t, Convert.ToBoolean(value), null);break;case "System.Double":pi.SetValue(t, Convert.ToDouble(value), null);break;case "System.Decimal":pi.SetValue(t, Convert.ToDecimal(value), null);break;case "System.Single":pi.SetValue(t, Convert.ToSingle(value), null);break;default:pi.SetValue(t, value, null);break;}}catch{//throw (new Exception(ex.Message));
                        }#endregion}}tList.Add(t);}}dr.Close();return tList;}#endregion#region 序列化、反序列化/// <summary>/// 对象序列化/// </summary>/// <typeparam name="T"></typeparam>/// <param name="obj"></param>/// <returns></returns>public static String Serialize<T>(T obj){String s;JavaScriptSerializer ser = new JavaScriptSerializer();ser.MaxJsonLength = Int32.MaxValue;s = ser.Serialize(obj);/*DataContractJsonSerializer ser = new DataContractJsonSerializer(obj.GetType());using (MemoryStream ms = new MemoryStream()) {ser.WriteObject(ms, obj);s = Encoding.Default.GetString(ms.ToArray());}*/return s;}/// <summary>/// 反序列化/// </summary>/// <typeparam name="T"></typeparam>/// <param name="json"></param>/// <returns></returns>public static T Deserialize<T>(String json){JavaScriptSerializer jss = new JavaScriptSerializer();return jss.Deserialize<T>(json);//T o;//json = HttpContext.Current.Server.UrlDecode(json);//JavaScriptSerializer ser = new JavaScriptSerializer();//ser.MaxJsonLength = Int32.MaxValue;//o = ser.Deserialize<T>(json);//return o;/*o = Activator.CreateInstance<T>();using (MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(json))) {DataContractJsonSerializer ser = new DataContractJsonSerializer(o.GetType());o = (T)(ser.ReadObject(ms));}*/}#endregion#region JSON文本转对象,泛型方法/// <summary>/// JSON文本转对象,泛型方法/// </summary>/// <typeparam name="T">类型</typeparam>/// <param name="jsonText">JSON文本</param>/// <returns>指定类型的对象</returns>public static T JSONToObject<T>(string jsonText){JavaScriptSerializer jss = new JavaScriptSerializer();try{return jss.Deserialize<T>(jsonText);}catch (Exception ex){throw new Exception("JSONHelper.JSONToObject(): " + ex.Message);}}#endregion#region 将JSON文本转换为数据表数据/// <summary>/// 将JSON文本转换为数据表数据/// </summary>/// <param name="jsonText">JSON文本</param>/// <returns>数据表字典</returns>public static Dictionary<string, List<Dictionary<string, object>>> TablesDataFromJSON(string jsonText){return JSONToObject<Dictionary<string, List<Dictionary<string, object>>>>(jsonText);}#endregion#region  将JSON文本转换成数据行/// <summary>/// 将JSON文本转换成数据行/// </summary>/// <param name="jsonText">JSON文本</param>/// <returns>数据行的字典</returns>public static Dictionary<string, object> DataRowFromJSON(string jsonText){return JSONToObject<Dictionary<string, object>>(jsonText);}#endregion
}

 后台Http请求

    /// <summary>/// /// </summary>/// <param name="url">网址</param>/// <param name="parase">参数</param>/// <param name="encoding">编码格式 </param>/// <returns></returns>public static string GetHttpPost(string url, string encoding){if (encoding == null)encoding = "gb2312";try{WebClient WC = new WebClient();WC.Headers.Add("Content-Type", "application/x-www-form-urlencoded");int p = url.IndexOf("?");string sData = url.Substring(p + 1);url = url.Substring(0, p);byte[] postData = Encoding.GetEncoding(encoding).GetBytes(sData);byte[] responseData = WC.UploadData(url, "POST", postData);string ct = Encoding.GetEncoding(encoding).GetString(responseData);return ct;}catch (Exception Ex){return Ex.Message;}}
View Code

 

转载于:https://www.cnblogs.com/yonsy/p/4446958.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/400496.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C语言实现的FFT与IFFT源代码,不依赖特定平台

目录源码FFT.cFFT.h使用方法初始化输入数据FFT 快速傅里叶变换解算FFT结果使用python绘制FFT波形IFFT 快速傅里叶逆变换解算IFFT结果Windows 10 20H2 Visual Studio 2015 Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on …

产品经理能力产品经理工作积累(3)

每日一贴,今天的内容关键字为产品经理能力 按职业司理的层次模型产品司理又可分工匠型,元帅型和老师型. (1). 工匠型 工匠型产品司理主要的代价在于:在某个专业领域里其技能的娴熟水平. (2). 元帅型 元帅型产品司理,可以在一个领域中带领一帮人来完成一个特定的项目.他的能力体…

垂直和水平居中方法小结

水平居中 行内元素 text-align:center; 块元素 1.定宽块元素水平居中 margin:0 auto; 2.不定宽块元素水平居中 方法一&#xff1a;利用浮动的包裹性和百分比相对定位 <div classouter><div classinner></div> </div> 我们想要使inner(不定宽)水平居中于…

MySQL命令行导出数据库

MySQL命令行导出数据库&#xff1a; 1&#xff0c;进入MySQL目录下的bin文件夹&#xff1a;cd MySQL中到bin文件夹的目录 如我输入的命令行&#xff1a;cd C:\Program Files\MySQL\MySQL Server 4.1\bin (或者直接将windows的环境变量path中添加该目录) 2&#xff0c;导出数据库…

在51单片机上使用递归的注意事项

目录问题应对措施原理普中51-单核-A2 STC89C52 Keil uVision V5.29.0.0 PK51 Prof.Developers Kit Version:9.60.0.0 问题 在Keil C51中直接使用递归会报如下警告&#xff1a; recursive call to non-reentrant function 为了提高运行效率&#xff0c;C51采用静态分配局部变量…

ASP.Net 获取服务器信息

1: Response.Write("服务器机器名&#xff1a;" Server.MachineName); 2: Response.Write("<br/>");3: Response.Write("服务器IP地址&#xff1a;" Request.ServerVariables["LOCAL_ADDR"]);4: Response.Write("<br/…

POJ 2456 - Aggressive cows(二分)

Description Farmer John has built a new long barn, with N (2 < N < 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 < xi < 1,000,000,000). His C (2 < C < N) cows don’t like this barn layout and becom…

〖Android〗存在多个Android设备时,使用Shell脚本选择一个Android设备

Shell脚本&#xff1a; #!/bin/bash devices( $(adb devices|grep device$|awk {print $1}|xargs echo) )case ${#devices[]} in0 )echo "cant found a android device!";;1 )serial$devices;;* )select serial in ${devices[]}; dobreak;done;; esacif [[ -z $seria…

C盘瘦身:QQ文件的清理及Group2文件夹

目录问题解决方法Windows 10 20H2 TIM 问题 最近C盘被撑爆了 使用SpaceSniffer一扫发现QQ的文件中有个Group2文件夹占了我17G 但使用QQ自带的个人文件夹清理却扫不到&#xff0c;据说直接删除会丢失近期所有群聊的聊天图片 解决方法 在这个地方找到了大神fsz1987给出的解…

分享20个Android游戏源代码。以后看看。

分享20个Android游戏源码&#xff0c;希望大家喜欢哈&#xff01;http://www.apkbus.com/android-21834-1-1.htmlAndroid 疯狂足球游戏源码http://www.apkbus.com/android-20986-1-1.htmlandroid源码捏苍蝇游戏源码http://www.apkbus.com/android-20987-1-1.htmlAndroid游戏源码…

【.Net】C# 将Access中时间段条件查询的数据添加到ListView中

一、让ListView控件显示表头的方法 在窗体中添加ListView 空间&#xff0c;其属性中设置&#xff1a;View属性设置为&#xff1a;Detail&#xff0c;Columns集合中添加表头中的文字。 二、利用代码给ListView添加Item。 首先&#xff0c;ListView的Item属性包括Items和SubItems…

获取ArcGIS安装路径

在要素类进行符号化时&#xff0c;使用axSymbologyControl需要安装路径下的Style文件路径&#xff0c;在AE9.3VS2008中是这样的&#xff1a; Microsoft.Win32.RegistryKey regKey Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\ESRI\\CoreRuntime",…

【51单片机快速入门指南】3.2:定时器/计数器

目录快速使用硬知识传统51单片机 CPU 时序的有关知识&#xff08;12T&#xff09;51 单片机定时器原理51 单片机定时/计数器结构定时器/计数器0/1定时器/计数器0和1的相关寄存器控制寄存器工作模式寄存器工作模式模式0(13位定时器/计数器)模式1(16位定时器/计数器)模式2(8位自动…

EBS并发管理器请求汇总(按照并发消耗时间,等待时间,平均等待事件等汇总)...

此数据集用于确定正在使用中并发管理器&#xff0c;并可与实际的在启动时分配的并发管理器。而且考虑完成状态为 正常/警告 的请求。 select q.concurrent_queue_name,count(*) cnt,sum(r.actual_completion_date - r.actual_start_date) * 24 elapsed,avg(r.actual_completion…

Linux内核RCU(Read Copy Update)锁简析

在非常早曾经&#xff0c;大概是2009年的时候。写过一篇关于Linux RCU锁的文章《RCU锁在linux内核的演变》&#xff0c;如今我承认。那个时候我尽管懂了RCU锁&#xff0c;可是我没有能力用一种非常easy的描写叙述把Linux的实现给展示出来&#xff0c;有道是你能给别人用你自己的…

sublime_text 3 注册序列号

为什么80%的码农都做不了架构师&#xff1f;>>> ----- BEGIN LICENSE ---- Andrew Weber Single User License EA7E-855605 813A03DD 5E4AD9E6 6C0EEB94 BC99798F 942194A6 02396E98 E62C9979 4BB979FE 91424C9D A45400BF F6747D88 2FB88078 90F5CC94 1CDC92DC 845…

【51单片机快速入门指南】3.2.1:PWM、呼吸灯与舵机

目录硬知识PWM&#xff08;脉冲宽度调制&#xff09;基本原理脉宽调制分类上机实战呼吸灯main.c中断服务函数修改TIM.c中的中断服务函数效果开发板电路分析舵机控制舵机控制方法main.c中断服务函数修改中断服务函数舵机测试程序main.c效果普中51-单核-A2 STC89C52 Keil uVisio…

Oracle常用查看表结构命令

转载自:http://blog.520591.com/1301 获取表&#xff1a; select table_name from user_tables; //当前用户的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表 select table_name from dba_tables where owner’用户名…

Centos7 安装oracle数据库

参考的内容&#xff1a; http://docs.oracle.com/cd/E11882_01/install.112/e24325/toc.htm#CHDCBCJF http://www.cnblogs.com/yingsong/p/6031452.html http://www.cnblogs.com/yingsong/p/6031235.html 步骤主要是有&#xff1a; 1、安装依赖的 软件包 2、创建用户和目录&…

ABAP常见面试问题

ABAP常见面试问题 1. What is the typical structure of an ABAP program? 2. What are field symbols and field groups.? Have you used "component idx of structure" clause with field groups? 3. What should be the approach for writing a BDC program? …