目标1:下载测试Html2Article软件(80分)。
目标2:在目标1的基础上,增加保存正文文本到文本文件的功能(90分)
添加代码如下
public string title = "";
public string content = "";
<pre name="code" class="csharp" style="font-family: 微软雅黑; line-height: 22.3999996185303px;">title = article.Title;
content = article.Content;
private void button1_Click(object sender, EventArgs e)
{
using (StreamWriter sw = new StreamWriter(@"D:\" + title + ".txt"))
{
sw.WriteLine(content);
}
}
private void titleTextBox_TextChanged(object sender, EventArgs e)
{
title = titleTextBox.Text;
}
开始界面
第一个网址
由于受限于windows系统的文件命名格式 , 需把标题中的特殊符号去掉才能点保存文本,如下图
第二个网址
由于QQ空间的它只有一个界面框架 , 其内部发消息给服务器才能看到日志内容 , 所以此程序不能显示主文内容
第三个网址