码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2016-02-24 17:34:22      阅读:864      评论:0      收藏:0      [点我收藏+]

标签:

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.     }  

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

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!