您的位置:首页 > Web前端 > HTML

将html代码写入临时文件夹下面的 然后发来给webbrowser使用

2012-12-14 09:51 204 查看
private void FormTemplatePreview_Load(object sender, EventArgs e)
{
this.textBoxReviewTitle.Text = this.Title.Trim();
this.webBrowser1.Url = new Uri(WriteHtmlToPath());
}

//将html代码写入临时文件夹下面的 然后发来给webbrowser使用
private string WriteHtmlToPath()
{
string tempPath = System.IO.Path.GetTempPath();
string htmlPath = Path.Combine(tempPath, @"tempReview.html");
if (!File.Exists(htmlPath))
{
File.Create(htmlPath);
}
File.WriteAllText(htmlPath, this.Content);
return htmlPath;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐