C# 自动计算字符串公式的值(三种方式)

时间:2016-02-24 17:32:51   收藏:0   阅读:409

http://www.csframework.com/archive/2/arc-2-20110426-1394.htm

 提供数据的WebForm2.aspx

 

 

 

[csharp] view plain copy
 
  1. public partial class WebForm2 : System.Web.UI.Page  
  2.     {  
  3.         protected void Page_Load(object sender, EventArgs e)  
  4.         {  
  5.             string callback = Request.QueryString["jsoncallback"];  
  6.             string data = "{\"title\": \"Recent Uploads tagged cat\",\"link\": \"http://www.sina.com.cn\",\"items\": [{\"title\": \"Russell 003\",\"color\": \"red\"},{\"title\": \"Cat [07.04.11]\",\"color\": \"yellow\"}]}";  
  7.             string result = string.Format("{0}({1})", callback, data);  
  8.             Response.Expires = -1;  
  9.             Response.Clear();  
  10.             Response.ContentEncoding = Encoding.UTF8;  
  11.             Response.ContentType = "application/json";  
  12.             Response.Write(result);  
  13.             Response.Flush();  
  14.             Response.End();  
  15.         }  
  16.     }  

原文:http://www.cnblogs.com/cylblogs/p/5213445.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!