Tag Archives: artical

生活碎片

Well, a new day is coming, I’m still preparing…

It’s so late now, the early morning of a new day, but no sleep can feel, may as the passion of the work, the passion to life, the hope to life.
Modifying some web code, and filing them to the web space, take a aroud look of the BBS, im286 or Chinabbs, at this time, I feel so peace, nothing disturb me but the sound of toppad, baby ava has slept for a long time as her headache, look at her face under the dark yellow light, peace, cute and lovely, a happy girl, with a happay the other, construct the happy family, I feel the power to work from my family, feel the happyness in life as I have a happy family, and I will take care… go step and step, make it going better.
At the next period, next few days, I will build the 2A studio, this will be the first thing, but the same time, I will make a plane about the big project, Piaobei net, I want construct a large flat of Beijing communication, with as most as possible informations. well, and think a while, how should I do exactly, maybe I should make a milestone for it, and plane it carefully, total…and do the next work then.
For my own job, I really love in it, and feel enjoy in it, I will not get relax about it, do everything as my best, go smoothly, peace, but passion, yeah~es,PASSION.

生活碎片

The first day of July.

Today,class overed so early,because of graduate party,lot of classmates back to school,there are few ones here,so the evening’s English class pulled up,today’s oral English we were practicing REQUESTION.this class ,my state is not good enought,maybe because of my headache,and the bad feeling is still borling me now.
Back to school,nobody at room,at first,I just thought our class had a gathering party,I called one and one again,Lele accepted me,there didn’t have any party.May most of the classmates will go home tommorow.
This summer,I’m not feel the sad emotion for the partation,everyday I studied so tired,the energy which left just to my baby,say my love to her
And today,I ended almost all of the courses between school and company,and tommorow,when I get the graduation card,I’m free.I will be not a student anymore.I’m looking forward….

程序人生

ASP.Net生成静态HTML页

ASP.Net生成静态HTML页

环境:Microsoft .NET Framework SDK v1.1
OS:Windows Server 2003 中文版

ASP.Net生成静态HTML页
在Asp中实现的生成静态页用到的FileSystemObject对象!
在.Net中涉及此类操作的是System.IO
以下是程序代码
//生成HTML页
public static bool WriteFile(string strText,string strContent,string strAuthor)
{
string path = HttpContext.Current.Server.MapPath(“/news/”);
Encoding code = Encoding.GetEncoding(“gb2312″);
// 读取模板文件
string temp = HttpContext.Current.Server.MapPath(“/news/text.html”);
StreamReader sr=null;
StreamWriter sw=null;
string str=”";
try
{
sr = new StreamReader(temp, code);
str = sr.ReadToEnd(); // 读取文件
}
catch(Exception exp)
{
HttpContext.Current.Response.Write(exp.Message);
HttpContext.Current.Response.End();
sr.Close();
}

string htmlfilename=DateTime.Now.ToString(“yyyyMMddHHmmss”)+”.html”;
// 替换内容
// 这时,模板文件已经读入到名称为str的变量中了
str =str.Replace(“ShowArticle”,strText); //模板页中的ShowArticle
str = str.Replace(“biaoti”,strText);
str = str.Replace(“content”,strContent);
str = str.Replace(“author”,strAuthor);
// 写文件
try
{
sw = new StreamWriter(path + htmlfilename , false, code);
sw.Write(str);
sw.Flush();
}
catch(Exception ex)
{
HttpContext.Current.Response.Write(ex.Message);
HttpContext.Current.Response.End();
}
finally
{
sw.Close();
}
return true;

此函数放在Conn.CS基类中了
在添加新闻的代码中引用 注:工程名为Hover

if(Hover.Conn.WriteFilethis.Title.Text.ToString),this.Content.Text.ToString),this.Author.Text.ToString)))
{
Response.Write(“添加成功”);
}
else
{
Response.Write(“生成HTML出错!”);
}
————————————————————————-
模板页Text.html代码
————————————————————————-







biaoti


content

author

生活碎片

今天了被~~`25号

今天是25号咯,因为早上要照毕业照,早早的就起来了,而且学校那边也请假了
嘿嘿 天气真是好的不得了阿,就是早早的起来太阳的欧晒得我直冒油啊,:P (总觉得这么说好土阿)
31号操场,晒得要死,没有离别的情绪。试了下霞姐的蛤蟆镜,林姐说我咋戴咋不斯文:P 罢了罢了,脱了就是了么
上午赶到学校都9:40,还算是蛮早得了,课都听得恹恹的,大概是今天上课的时间也太短了吧
下午竟然3点半都下课了,中午上课那么早,都没来得及打游戏,嘿嘿,其实是准备改改这个blog的
好了,说啥呢
没了
晚上上鲜汉,一个人,一个人吃饭,一个人喝酒
没人陪~`