C#Web浏览器打开本地网页错误 [英] C# web Browser Open Local Web Page Error

查看:95
本文介绍了C#Web浏览器打开本地网页错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用WPF在c#2008 Express Edition上编写一个简单的Web浏览器.它可以与www网站正常工作,并且可以正确显示所有内容.但是,如果我要打开一些本地网页-例如"file://C:1/1.htm",它将保存该网页而不是显示它.我正在使用Windows7 x64.我将我的应用程序设置为* .htm文件的默认程序,但是并没有帮助.
我将非常感谢您的帮助.

亲切的问候,
Pavel

Hello to every one,

I am writing a simple web browser on c# 2008 express edition using WPF. It is working fine with www websites and display all content correctly. But if I want to open some local webpage - for instance "file://C:1/1.htm", it is save the webpage instead of displaying it. Im using windows7 x64. I made my application default programm for *.htm files, but it didn`t help.
I will really appreciate any help.

Kind regards,
Pavel

推荐答案

您不是在编写网络浏览器.您正在编写Internet Explorer的包装,C#将其作为控件提供给您.

You''re not writing a web browser. You''re writing a wrapper for Internet Explorer, which C# gives to you as a control.

PDLajus写道:
PDLajus wrote:

"file://C:1/1.htm",

"file://C:1/1.htm",



C:1不是正确的路径,这是错字吗?您使用什么方法打开页面?



C:1 is not a proper path, is this a typo ? What method are you using to open the pages ?


谢谢您的答复,克里斯蒂安.
该地址仅作为示例,我尝试了很多不同的地址.
我尝试了方法-Webbrowser1.Navigate,并且还将网址放在webbrowser1属性的源"字段中.
有人告诉我,可能我的本地计算机上没有某些服务器进程.有人认为是IIS.
Thank you for the reply, Christian.
This address is just for an example, I tried a lot of different addresses.
I tried methods - Webbrowser1.Navigate, and also I put web address in the field "source" of the webbrowser1 properties.
One person told me that probably I don`t have some server processes in my local machine running. Some think called IIS.


我也在尝试相同的方法...
我建议在表单对象创建期间将url作为参数传递,就像在使用浏览器的exe打开html页面期间传递参数....
但是我不知道如何在双击本地保存的网页时传递本地路径....


如果您找到解决方案,请通过hk_maniya@yahoo.co.in回复我.
谢谢....
i am also trying same.....
i suggest to pass url during form object creation as parameter like during open html page with your browser''s exe....
but i don''t know how to pass local path while double clicking on local saved webpage ....


if you find solution reply me on hk_maniya@yahoo.co.in...
thanks....


这篇关于C#Web浏览器打开本地网页错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆