【发布时间】:2011-02-01 18:36:47
【问题描述】:
我正在使用 Microsoft Visual Studio 2005,我可以使用
加载网页string exePath = Application.ExecutablePath ;
int n = exePath.LastIndexOf("\\");
// the web page & image is in the same directory as the executable
string filename = exePath.Substring(0, n)+ "\\switchboard.htm";
webBrowser1.DocumentStream = new FileStream(filename, FileMode.Open);
网页的文本加载正常,但是这个
<img src="cardpack1.jpg" height="200" alt="card">
导致图像损坏。
图像文件与 html 文件位于同一目录中。 我什至不确定要谷歌什么。我发现的所有问题似乎都在做 更有趣的事情,例如从资源包中解析图像并尝试动态处理 显示/不显示图像。
所以,任何建议都将不胜感激(即使它只是 ... google for x, y, z)
【问题讨论】:
标签: c# .net winforms webbrowser-control