ぷ行走de猫げ

在快乐中成长,在快乐中学习!

获取html

//获取模板
                                string fileName = "E:\\MailSend\\MailSend\\MailSend\\MailTemplete\\MailSkyTypeTemplet.htm";
                                FileStream aFile;
                                try
                                {
                                    aFile = new FileStream(fileName, FileMode.Open, FileAccess.Read);
                                }
                                catch
                                {
                                    return;
                                }
                                StreamReader sr = new StreamReader(aFile, Encoding.UTF8);

                                string templet = sr.ReadToEnd();
                                sr.Close();
                                #endregion
                                #region get templet

                                //获取模板
                                string fileNamebox = "E:\\MailSend\\MailSend\\MailSend\\MailTemplete\\MessageBoxTemplet.htm";
                                //FileStream aFilebox;
                                try
                                {
                                    aFile = new FileStream(fileNamebox, FileMode.Open, FileAccess.Read);
                                }
                                catch
                                {
                                    return;
                                }
                                sr = new StreamReader(aFile, Encoding.UTF8);

                                string templetbox = sr.ReadToEnd();
                                sr.Close();
                                #endregion
                                string body = GetString(templet, "_beginHead", "_endFoot", "");
                                string bodybox = GetString(templetbox, "_beginHead", "_endFoot", "");

posted @ 2012-05-03 14:47  李天翔  阅读(148)  评论(0编辑  收藏  举报