本文整理汇总了C#中JavaScriptSerializer.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# JavaScriptSerializer.Remove方法的具体用法?C# JavaScriptSerializer.Remove怎么用?C# JavaScriptSerializer.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JavaScriptSerializer
的用法示例。
在下文中一共展示了JavaScriptSerializer.Remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: modify
public static Hashtable modify(String data, String executor)
{
Hashtable t_return = new Hashtable();
SQLiteConnection conn = tools.getSqliteConn();
SQLiteCommand comd = new SQLiteCommand();
comd.Connection = conn;
SQLiteDataReader rd = null;
String sql = "";
Hashtable t_data = new JavaScriptSerializer().Deserialize<Hashtable>(data);
String username = (String)t_data["username"];
t_data.Remove("username");
String group_code = (String)t_data["group_code"];
sql = "delete from basic_group_2_user where user_code = '" + username + "' ;";
comd.CommandText = sql;
comd.ExecuteNonQuery();
sql = "insert into basic_group_2_user (user_code,group_code) values ('" + username + "','" + group_code + "');";
comd.CommandText = sql;
comd.ExecuteNonQuery();
IDictionaryEnumerator en = t_data.GetEnumerator();
Hashtable t_data2 = new Hashtable();
while (en.MoveNext())
{
String value = en.Value.ToString();
String key = en.Key.ToString();
t_data2.Add(key, "'" + value + "'");
}
t_data = t_data2;
t_data.Add("time_lastupdated", "now()");
t_data.Add("count_updated", "count_updated+1");
en = t_data.GetEnumerator();
sql = "update basic_user set ";
int columns = 0;
while (en.MoveNext())
{
columns++;
String value = en.Value.ToString();
String key = en.Key.ToString();
sql += key+ " = "+value+" ,";
}
sql = sql.Substring(0, sql.Length - 1);
sql += " where username = '"+username+"'";
comd.CommandText = sql;
comd.ExecuteNonQuery();
conn.Close();
t_return.Add("status","1");
t_return.Add("columns",columns);
return t_return;
}
示例2: modify
public static Hashtable modify(String data, String executor)
{
Hashtable t_return = new Hashtable();
SQLiteConnection conn = tools.getSqliteConn();
SQLiteCommand comd = new SQLiteCommand();
comd.Connection = conn;
SQLiteDataReader rd = null;
String sql = "";
Hashtable t_data = new JavaScriptSerializer().Deserialize<Hashtable>(data);
String code = (String)t_data["code"];
t_data.Remove("code");
IDictionaryEnumerator en = t_data.GetEnumerator();
Hashtable t_data2 = new Hashtable();
while (en.MoveNext())
{
String value = en.Value.ToString();
String key = en.Key.ToString();
t_data2.Add(key, "'" + value + "'");
}
t_data = t_data2;
en = t_data.GetEnumerator();
sql = "update basic_group set ";
int columns = 0;
while (en.MoveNext())
{
columns++;
String value = en.Value.ToString();
String key = en.Key.ToString();
sql += key + " = " + value + " ,";
}
sql = sql.Substring(0, sql.Length - 1);
sql += " where code = '" + code + "'";
comd.CommandText = sql;
comd.ExecuteNonQuery();
conn.Close();
t_return.Add("status", "1");
t_return.Add("columns", columns);
return t_return;
}