好像用WebBrowser无法实现,这里有一个其他方法 —— Load MHT and Send as Email
dudu亲自来回答这个问题,看样子dudu对博客园的类StockOverfolow提问模式投入了很多精力了,虽然您的回答对我没有太大帮助,但是我还是解决了这个问题,虽然不是很优雅,不过还是一个解决方案,总的思想是把MHT文件存成临时文件,用WEBBROWSER的Navigate方法打开,代码如下:
//从程序集中读取资源文件
Assembly asmm = Assembly.GetCallingAssembly();
Assembly asm = Assembly.ReflectionOnlyLoadFrom(AddInfo.HTMLAssembly);
Stream str=asm.GetManifestResourceStream(AddInfo.HTMLNavigationFile);
if (str == null)
return false;
//保存成临时文件
string vFilePath=AppDomain.CurrentDomain.BaseDirectory + "Temp";
string vFileName =vFilePath + "\\index.mht";//我资源文件里面的MHT文件
if (Directory.Exists(vFilePath) == false)
Directory.CreateDirectory(vFilePath);
if (File.Exists(vFileName))
File.Delete(vFileName);
StreamReader sr = new StreamReader(str);
StreamWriter sw = new StreamWriter(vFileName);
sw.Write(sr.ReadToEnd());
sw.Flush();
sw.Close();
sr.Close();
//webbrowser加载
wbNavigation.Navigate("file://"+vFileName);
while (wbNavigation.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
此问题,我已自己解决