str = str.Replace("$Index_CClass$", bll.Index_CClass());
str = str.Replace("$Index_Brand$", bll.Index_Brand());
str = str.Replace("$Index_ZhongBrand$", bll.Index_ZhongBrand());
str = str.Replace("$Index_FoodPH$", bll.Index_PH("200808141410131718","8"));
str = str.Replace("$Index_WinePH$", bll.Index_PH("200808060950287500","5"));
str = str.Replace("$Index_BthPH$", bll.Index_PH("200808051413042031", "5"));
str = str.Replace("$Index_TeaPH$", bll.Index_PH("200808060950345625", "5"));用Replace是做什么用的,里面的$Index_Brand$干嘛用的? 为什么老是换..换这么多次做什么??
str = str.Replace("$Index_Brand$", bll.Index_Brand());
str = str.Replace("$Index_ZhongBrand$", bll.Index_ZhongBrand());
str = str.Replace("$Index_FoodPH$", bll.Index_PH("200808141410131718","8"));
str = str.Replace("$Index_WinePH$", bll.Index_PH("200808060950287500","5"));
str = str.Replace("$Index_BthPH$", bll.Index_PH("200808051413042031", "5"));
str = str.Replace("$Index_TeaPH$", bll.Index_PH("200808060950345625", "5"));用Replace是做什么用的,里面的$Index_Brand$干嘛用的? 为什么老是换..换这么多次做什么??
解决方案 »
- conn.open()
- 有人用过authorize.net这个美国第三方付费平台吗?求解DPM方式下如何取得返回值?谢谢
- ASP.NET生成静态页的问题??????
- 在vs.net2005中怎么为aspx添加一个后置的.cs文件?
- 非常简单的问题,服务器端运行的button,能否在它的OnClick事件中,执行javascript脚本?
- 安装IIS之后 上默认网站出现账户和密码 什么情况?
- 怎样把一个项目放到别的项目中去???
- 感谢帮助,请来接分
- 在线等,高手出来帮忙~~ 如何得到本页转向的Url
- 求助,SQL求两列时间差的平均值,需要条件过滤
- 我在后台管理点击生成index.htm的静态页, 在根目录打开是不一样的?为什么?有没有存在缓存问题?
- 《急!!!》视频抓图
Replace 字符的替换方法
str中的'$Index_CClass$' 字符串替换成 bll.Index_CClass() 方法返回的字符串
内同大致:<b>Hi,$name$</b>
<div>I am your friend, $myName$. I want to tell you that you are a fool. Aha...</div>
<div style="margin-left:200px;">Click <a href="$url$" target="_blank">here</a> to see the detail info.</div>
---------------------
.aspx.cs代码using System.IO;
using System.Collections.Generic;protect void Send(object sender,EventArgs e)
{
string name="you foolish pig";
string myName="the most clever human-being";
string url="http://topic.csdn.net/u/20090210/13/36bb4e87-e44e-45e0-9698-077b4bfd079e.html?seed=292900552";//get from datasource or viewstate
StringBuilder MailBody = new StringBuilder();
using (StreamReader sr = new StreamReader(Server.MapPath("../Email/NewCommentEmail.html")))
{
string line = String.Empty;
while ((line = sr.ReadLine()) != null)
{
MailBody.Append(line);
MailBody.Append("\n");
}
}
MailBody.Replace("$name$",name).Replace("$myName$",myName).Replace("$url$",url);
Common.SendEmail("A great legend...","[email protected]",MailBody.ToString()); }