解决方案 »
- winform下如何吧个人简历导出word?
- 求一个用c#编写的简易高速公路收费系统 最好有源代码 非常感谢
- 请问怎样用webbrowser获取这个页面http://stock.bbs.hexun.com/docidx1.aspx?bid=2的完整html
- 文本编辑器时遇到的问题,怎样实现将文件拖到窗口打开文件。
- 请问一下大家,谢谢!
- 关于窗体显示的问题???
- 求大神:如何加快绘图速度?
- 我在VS2010中把光标放在函数名上 会出现关于函数的提示 在后面有个(+1重载)是什么意思?
- 谁有表达式计算的C#的源码或者可以在C#里面调用的dll的
- 在WinForm中用浏览器控件装载Word文件时能显示Word自身的工具条?
- NetworkStream.write往smtp服务器发邮件,中文乱码。如下代码
- 多线程交互
调用saveHtml(传入DocumentText的文本,html标题,返回的url给webBrowser.Navigate的) private void saveHtml(string htmltext, string title, out string url)
{ //----------生成htm文件------------------――
string dirPath = System.Environment.CurrentDirectory + "\\" + htmlDir; if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
} string filePath = dirPath + "\\" + title + ".htm"; if (!File.Exists(filePath))
{
FileStream fs = new FileStream(filePath, FileMode.Create);
fs.Close(); try
{
using (StreamWriter sw = new StreamWriter(filePath, true, Encoding.Unicode)) //保存地址
{
sw.WriteLine(htmltext);
sw.Flush();
sw.Close(); } }
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
url = filePath; }