public class jsonSample : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "application/json";
Person p = new Person();
p.name = "Richard";
p.address.Add("Taipei");
p.address.Add("US");
// .NET 3.5 & 4 solution
// Reference : http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx
System.Web.Script.Serialization.JavaScriptSerializer serializer =
new System.Web.Script.Serialization.JavaScriptSerializer();
context.Response.Write(serializer.Serialize(p));
// Json.NET solution
// Reference : http://json.codeplex.com/
context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(p));
/* Result:
*
* {"name":"Richard","address":["Taipei","US"]}
*
*/
}
public bool IsReusable
{
get
{
return false;
}
}
}
public class Person
{
public List<string> address = new List<string>();
public string name;
}
.NET Generic Handler(ashx) Object to JSON Serialization
Speed up SQL Server Management Studio (SSMS)
[Solution] : Add an entry in your HOSTS
- Press the keys [Win] + [R]
- notepad %systemroot%\system32\drivers\etc\hosts.
- Append the following..
127.0.0.1 crl.microsoft.com - Save the file.
ref: http://www.virtualobjectives.com.au/sqlserver/ssms_slow.htm
[Solution] : Use sqlwb Utility –nosplash arguments
ex:
- ssms.exe –nosplash
- ssms.exe -nosplash -S "."
- ssms.exe -nosplash -S ".\SQLEXPRESS"
ref: http://msdn.microsoft.com/en-us/library/ms162825%28v=sql.90%29.aspx
[Solution] : Uncheck “Check publisher’s certificate revocation”
- Go into IE, select Tools|Internet Options|Advanced
- If “Check publisher's certificate revocation” under the security node is checked, then uncheck it.
ref: http://blogs.msdn.com/b/euanga/archive/2006/07/11/662053.aspx
訂閱:
文章 (Atom)